emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112805: * progmodes/octave.el (octav


From: Leo Liu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112805: * progmodes/octave.el (octave-mode-syntax-table): Give `.'
Date: Sat, 01 Jun 2013 11:38:36 +0800
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112805
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Sat 2013-06-01 11:38:36 +0800
message:
  * progmodes/octave.el (octave-mode-syntax-table): Give `.'
  punctuation syntax.
  (inferior-octave-minimal-columns)
  (inferior-octave-last-column-width): New variables.
  (inferior-octave-track-window-width-change): New function.
  (inferior-octave-mode): Adjust column width so that Octave output,
  for example from 'ls', can fit into the window nicely.
modified:
  lisp/ChangeLog
  lisp/progmodes/octave.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-05-31 16:55:03 +0000
+++ b/lisp/ChangeLog    2013-06-01 03:38:36 +0000
@@ -1,3 +1,13 @@
+2013-06-01  Leo Liu  <address@hidden>
+
+       * progmodes/octave.el (octave-mode-syntax-table): Give `.'
+       punctuation syntax.
+       (inferior-octave-minimal-columns)
+       (inferior-octave-last-column-width): New variables.
+       (inferior-octave-track-window-width-change): New function.
+       (inferior-octave-mode): Adjust column width so that Octave output,
+       for example from 'ls', can fit into the window nicely.
+
 2013-05-31  Dmitry Gutov  <address@hidden>
 
        * progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p):

=== modified file 'lisp/progmodes/octave.el'
--- a/lisp/progmodes/octave.el  2013-05-29 06:50:48 +0000
+++ b/lisp/progmodes/octave.el  2013-06-01 03:38:36 +0000
@@ -191,10 +191,9 @@
     (modify-syntax-entry ?! "."   table)
     (modify-syntax-entry ?\\ "."  table)
     (modify-syntax-entry ?\' "."  table)
-    ;; Was "w" for abbrevs, but now that it's not necessary any more,
     (modify-syntax-entry ?\` "."  table)
+    (modify-syntax-entry ?. "."   table)
     (modify-syntax-entry ?\" "\"" table)
-    (modify-syntax-entry ?. "_"   table)
     (modify-syntax-entry ?_ "_"   table)
     ;; The "b" flag only applies to the second letter of the comstart
     ;; and the first letter of the comend, i.e. the "4b" below is ineffective.
@@ -676,13 +675,16 @@
   (setq-local eldoc-documentation-function 'octave-eldoc-function)
 
   (setq comint-input-ring-file-name
-       (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist")
-       comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024))
+        (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist")
+        comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024))
   (setq-local comint-dynamic-complete-functions
               inferior-octave-dynamic-complete-functions)
   (setq-local comint-prompt-read-only inferior-octave-prompt-read-only)
   (add-hook 'comint-input-filter-functions
             'inferior-octave-directory-tracker nil t)
+  ;; http://thread.gmane.org/gmane.comp.gnu.octave.general/48572
+  (add-hook 'window-configuration-change-hook
+            'inferior-octave-track-window-width-change nil t)
   (comint-read-input-ring t))
 
 ;;;###autoload
@@ -913,6 +915,24 @@
   (inferior-octave-send-list-and-digest '("disp (pwd ())\n"))
   (cd (car inferior-octave-output-list)))
 
+(defcustom inferior-octave-minimal-columns 80
+  "The minimal column width for the inferior Octave process."
+  :type 'integer
+  :group 'octave
+  :version "24.4")
+
+(defvar inferior-octave-last-column-width nil)
+
+(defun inferior-octave-track-window-width-change ()
+  ;; http://thread.gmane.org/gmane.comp.gnu.octave.general/48572
+  (let ((width (max inferior-octave-minimal-columns (window-width))))
+    (unless (eq inferior-octave-last-column-width width)
+      (setq-local inferior-octave-last-column-width width)
+      (when (and inferior-octave-process
+                 (process-live-p inferior-octave-process))
+        (inferior-octave-send-list-and-digest
+         (list (format "putenv(\"COLUMNS\", \"%s\");\n" width)))))))
+
 
 ;;; Miscellaneous useful functions
 
@@ -1639,11 +1659,7 @@
           (when (re-search-forward "^\\s-*See also:" nil t)
             (let ((end (save-excursion (re-search-forward "^\\s-*$" nil t))))
               (while (re-search-forward "\\_<\\(?:\\sw\\|\\s_\\)+\\_>" end t)
-                (make-text-button (match-beginning 0)
-                                  ;; If the match ends with . exclude it.
-                                  (if (eq (char-before (match-end 0)) ?.)
-                                      (1- (match-end 0))
-                                    (match-end 0))
+                (make-text-button (match-beginning 0) (match-end 0)
                                   :type 'octave-help-function)))))
         (octave-help-mode)))))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]