aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2013-05-13 15:24:22 +0800
committerLeo Liu2013-05-13 15:24:22 +0800
commitb0e069c2ac35e6daba0470d61289dfc4f07e7246 (patch)
treeb5321206ebcd48efe2d703509d989b9c3f188237
parentbb8eb35723ef08983b45382a442df90a4e48b3d3 (diff)
downloademacs-b0e069c2ac35e6daba0470d61289dfc4f07e7246.tar.gz
emacs-b0e069c2ac35e6daba0470d61289dfc4f07e7246.zip
* progmodes/octave.el (octave-indent-comment): Fix indentation for %!.
(octave-comment-start-skip): Include %!. (octave-mode): Set comment-start-skip to octave-comment-start-skip.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/octave.el10
2 files changed, 8 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9fdb5fdc6f8..ac5a5c34e44 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,9 +1,11 @@
12013-05-13 Leo Liu <sdl.web@gmail.com> 12013-05-13 Leo Liu <sdl.web@gmail.com>
2 2
3 * progmodes/octave.el (octave-indent-comment): Fix the indentation 3 * progmodes/octave.el (octave-indent-comment): Fix indentation for
4 of ### or %%%. 4 ###, and %!.
5 (octave-mode-map): Bind octave-indent-defun to C-c C-q instead of 5 (octave-mode-map): Bind octave-indent-defun to C-c C-q instead of
6 C-M-q. 6 C-M-q.
7 (octave-comment-start-skip): Include %!.
8 (octave-mode): Set comment-start-skip to octave-comment-start-skip.
7 9
82013-05-12 Leo Liu <sdl.web@gmail.com> 102013-05-12 Leo Liu <sdl.web@gmail.com>
9 11
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index fc1e7bb757e..7189b606a0c 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -64,7 +64,7 @@ Used in `octave-mode' and `inferior-octave-mode' buffers.")
64 (string octave-comment-char ?\s) 64 (string octave-comment-char ?\s)
65 "String to insert to start a new Octave in-line comment.") 65 "String to insert to start a new Octave in-line comment.")
66 66
67(defvar octave-comment-start-skip "\\s<+\\s-*" 67(defvar octave-comment-start-skip "\\(?:%!\\|\\s<+\\)\\s-*"
68 "Regexp to match the start of an Octave comment up to its body.") 68 "Regexp to match the start of an Octave comment up to its body.")
69 69
70(defvar octave-begin-keywords 70(defvar octave-begin-keywords
@@ -439,7 +439,8 @@ Non-nil means always go to the next Octave code line after sending."
439 ((octave-in-string-or-comment-p) nil) 439 ((octave-in-string-or-comment-p) nil)
440 ((looking-at-p "\\s<\\{3,\\}") 440 ((looking-at-p "\\s<\\{3,\\}")
441 0) 441 0)
442 ((and (looking-at-p "\\s<\\(?:[^{}]\\|$\\)") 442 ;; Exclude %{, %} and %!.
443 ((and (looking-at-p "\\s<\\(?:[^{}!]\\|$\\)")
443 (not (looking-at-p "\\s<\\s<"))) 444 (not (looking-at-p "\\s<\\s<")))
444 (comment-choose-indent))))) 445 (comment-choose-indent)))))
445 446
@@ -532,10 +533,7 @@ definitions can also be stored in files and used in batch mode."
532 533
533 (setq-local comment-start octave-comment-start) 534 (setq-local comment-start octave-comment-start)
534 (setq-local comment-end "") 535 (setq-local comment-end "")
535 ;; Don't set it here: it's not really a property of the language, 536 (setq-local comment-start-skip octave-comment-start-skip)
536 ;; just a personal preference of the author.
537 ;; (setq-local comment-column 32)
538 (setq-local comment-start-skip "\\s<+\\s-*")
539 (setq-local comment-add 1) 537 (setq-local comment-add 1)
540 538
541 (setq-local parse-sexp-ignore-comments t) 539 (setq-local parse-sexp-ignore-comments t)