aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2013-05-22 07:05:16 +0800
committerLeo Liu2013-05-22 07:05:16 +0800
commitee44b62a9cf6716139a963afe06c5db60af1a41a (patch)
treebb3e66416a3582cc50bdb091c09d74f57d0b341a
parentfc30d803f4325ebf67eee72a5a98100f01f6b182 (diff)
downloademacs-ee44b62a9cf6716139a963afe06c5db60af1a41a.tar.gz
emacs-ee44b62a9cf6716139a963afe06c5db60af1a41a.zip
* progmodes/octave.el (octave-mode-menu): Update and re-organize
menu items. (octave-mode): Tweak fill-nobreak-predicate. (inferior-octave-startup): Check process to avoid infinite loop. (inferior-octave): Pop to buffer first to show abornmal process exit information.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/progmodes/octave.el84
2 files changed, 58 insertions, 35 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4d2186ba073..5a74fa4a21f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12013-05-21 Leo Liu <sdl.web@gmail.com>
2
3 * progmodes/octave.el (octave-mode-menu): Update and re-organize
4 menu items.
5 (octave-mode): Tweak fill-nobreak-predicate.
6 (inferior-octave-startup): Check process to avoid infinite loop.
7 (inferior-octave): Pop to buffer first to show abornmal process
8 exit information.
9
12013-05-21 Glenn Morris <rgm@gnu.org> 102013-05-21 Glenn Morris <rgm@gnu.org>
2 11
3 * printing.el (pr-menu-bar): Define when compiling. 12 * printing.el (pr-menu-bar): Define when compiling.
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 76172d5b59a..9810ae27274 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -132,38 +132,49 @@ parenthetical grouping.")
132(easy-menu-define octave-mode-menu octave-mode-map 132(easy-menu-define octave-mode-menu octave-mode-map
133 "Menu for Octave mode." 133 "Menu for Octave mode."
134 '("Octave" 134 '("Octave"
135 ("Lines" 135 ["Split Line at Point" octave-indent-new-comment-line t]
136 ["Previous Code Line" octave-previous-code-line t] 136 ["Previous Code Line" octave-previous-code-line t]
137 ["Next Code Line" octave-next-code-line t] 137 ["Next Code Line" octave-next-code-line t]
138 ["Begin of Continuation" octave-beginning-of-line t] 138 ["Begin of Line" octave-beginning-of-line t]
139 ["End of Continuation" octave-end-of-line t] 139 ["End of Line" octave-end-of-line t]
140 ["Split Line at Point" octave-indent-new-comment-line t]) 140 ["Mark Block" octave-mark-block t]
141 ("Blocks" 141 ["Close Block" smie-close-block t]
142 ["Mark Block" octave-mark-block t] 142 "---"
143 ["Close Block" smie-close-block t]) 143 ["Start Octave Process" run-octave t]
144 ("Functions" 144 ["Lookup Documentation" info-lookup-symbol t]
145 ["Insert Function" octave-insert-defun t] 145 ["Help on Function" octave-help t]
146 ["Update function file comment" octave-update-function-file-comment t]) 146 ["Find Function Definition" octave-find-definition t]
147 "-" 147 ["Insert Function" octave-insert-defun t]
148 ["Update Function File Comment" octave-update-function-file-comment t]
149 "---"
150 ["Function Syntax Hints" (call-interactively
151 (if (fboundp 'eldoc-post-insert-mode)
152 'eldoc-post-insert-mode
153 'eldoc-mode))
154 :style toggle :selected (or eldoc-post-insert-mode eldoc-mode)
155 :help "Display function signatures after typing `SPC' or `('"]
156 ["Delimiter Matching" smie-highlight-matching-block-mode
157 :style toggle :selected smie-highlight-matching-block-mode
158 :help "Highlight matched pairs such as `if ... end'"
159 :visible (fboundp 'smie-highlight-matching-block-mode)]
160 ["Auto Fill" auto-fill-mode
161 :style toggle :selected auto-fill-function
162 :help "Automatic line breaking"]
163 ["Electric Layout" electric-layout-mode
164 :style toggle :selected electric-layout-mode
165 :help "Automatically insert newlines around some chars"]
166 "---"
148 ("Debug" 167 ("Debug"
149 ["Send Current Line" octave-send-line t] 168 ["Send Current Line" octave-send-line t]
150 ["Send Current Block" octave-send-block t] 169 ["Send Current Block" octave-send-block t]
151 ["Send Current Function" octave-send-defun t] 170 ["Send Current Function" octave-send-defun t]
152 ["Send Region" octave-send-region t] 171 ["Send Region" octave-send-region t]
153 ["Show Process Buffer" octave-show-process-buffer t] 172 ["Show Process Buffer" octave-show-process-buffer t]
154 ["Hide Process Buffer" octave-hide-process-buffer t] 173 ["Hide Process Buffer" octave-hide-process-buffer t]
155 ["Kill Process" octave-kill-process t]) 174 ["Kill Process" octave-kill-process t])
156 "-" 175 "---"
157 ["Indent Line" indent-according-to-mode t] 176 ["Customize Octave" (customize-group 'octave) t]
158 ["Complete Symbol" completion-at-point t] 177 ["Submit Bug Report" report-emacs-bug t]))
159 ["Toggle Auto-Fill Mode" auto-fill-mode
160 :style toggle :selected auto-fill-function]
161 "-"
162 ["Describe Octave Mode" describe-mode t]
163 ["Lookup Octave Index" info-lookup-symbol t]
164 ["Customize Octave" (customize-group 'octave) t]
165 "-"
166 ["Submit Bug Report" report-emacs-bug t]))
167 178
168(defvar octave-mode-syntax-table 179(defvar octave-mode-syntax-table
169 (let ((table (make-syntax-table))) 180 (let ((table (make-syntax-table)))
@@ -543,7 +554,8 @@ definitions can also be stored in files and used in batch mode."
543 554
544 ;; Use `smie-auto-fill' after fixing bug#14381. 555 ;; Use `smie-auto-fill' after fixing bug#14381.
545 (setq-local normal-auto-fill-function 'do-auto-fill) 556 (setq-local normal-auto-fill-function 'do-auto-fill)
546 (setq-local fill-nobreak-predicate #'octave-in-string-p) 557 (setq-local fill-nobreak-predicate
558 (lambda () (eq (octave-in-string-p) ?')))
547 (setq-local comment-line-break-function #'octave-indent-new-comment-line) 559 (setq-local comment-line-break-function #'octave-indent-new-comment-line)
548 560
549 (setq font-lock-defaults '(octave-font-lock-keywords)) 561 (setq font-lock-defaults '(octave-font-lock-keywords))
@@ -689,12 +701,12 @@ the file specified by `inferior-octave-startup-file' or by the default
689startup file, `~/.emacs-octave'." 701startup file, `~/.emacs-octave'."
690 (interactive "P") 702 (interactive "P")
691 (let ((buffer (get-buffer-create inferior-octave-buffer))) 703 (let ((buffer (get-buffer-create inferior-octave-buffer)))
704 (unless arg
705 (pop-to-buffer buffer))
692 (unless (comint-check-proc buffer) 706 (unless (comint-check-proc buffer)
693 (with-current-buffer buffer 707 (with-current-buffer buffer
694 (inferior-octave-startup) 708 (inferior-octave-startup)
695 (inferior-octave-mode))) 709 (inferior-octave-mode)))
696 (unless arg
697 (pop-to-buffer buffer))
698 buffer)) 710 buffer))
699 711
700;;;###autoload 712;;;###autoload
@@ -724,6 +736,8 @@ startup file, `~/.emacs-octave'."
724 ;; output may be mixed up). Hence, we need to digest the Octave 736 ;; output may be mixed up). Hence, we need to digest the Octave
725 ;; output to see when it issues a prompt. 737 ;; output to see when it issues a prompt.
726 (while inferior-octave-receive-in-progress 738 (while inferior-octave-receive-in-progress
739 (or (process-live-p inferior-octave-process)
740 (error "Process `%s' died" inferior-octave-process))
727 (accept-process-output inferior-octave-process)) 741 (accept-process-output inferior-octave-process))
728 (goto-char (point-max)) 742 (goto-char (point-max))
729 (set-marker (process-mark proc) (point)) 743 (set-marker (process-mark proc) (point))
@@ -1296,7 +1310,7 @@ The block marked is the one that contains point or follows point."
1296 (and (= (current-column) cfc) (eolp))) 1310 (and (= (current-column) cfc) (eolp)))
1297 (forward-line 1) 1311 (forward-line 1)
1298 (if (not (eolp)) (insert " ")) 1312 (if (not (eolp)) (insert " "))
1299 (or (do-auto-fill) 1313 (or (funcall normal-auto-fill-function)
1300 (forward-line 1)))) 1314 (forward-line 1))))
1301 t))) 1315 t)))
1302 1316