emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Leo Liu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112550: * progmodes/octave.el (octave-indent-comment): New function.
Date: Sat, 11 May 2013 14:20:10 +0800
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112550
fixes bug: http://debbugs.gnu.org/14350
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Sat 2013-05-11 14:20:10 +0800
message:
  * progmodes/octave.el (octave-indent-comment): New function.
  (octave-mode): Use it in smie-indent-functions.
modified:
  lisp/ChangeLog
  lisp/progmodes/octave.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-05-11 03:50:34 +0000
+++ b/lisp/ChangeLog    2013-05-11 06:20:10 +0000
@@ -3,6 +3,8 @@
        * progmodes/octave.el (octave-beginning-of-line)
        (octave-end-of-line): Check before using up-list because it jumps
        out of more syntactic contructs since moving to smie.
+       (octave-indent-comment): New function.
+       (octave-mode): Use it in smie-indent-functions.  (Bug#14350)
 
 2013-05-11  Glenn Morris  <address@hidden>
 

=== modified file 'lisp/progmodes/octave.el'
--- a/lisp/progmodes/octave.el  2013-05-11 03:50:34 +0000
+++ b/lisp/progmodes/octave.el  2013-05-11 06:20:10 +0000
@@ -414,6 +414,13 @@
        ;; (if (smie-parent-p "switch") 4)
        0))))
 
+(defun octave-indent-comment ()
+  "A function for `smie-indent-functions' (which see)."
+  (save-excursion
+    (back-to-indentation)
+    (when (and (looking-at-p "\\s<") (not (looking-at-p "\\s<\\s<")))
+      (comment-choose-indent))))
+
 
 (defvar octave-font-lock-keywords
   (list
@@ -488,6 +495,7 @@
               :forward-token  #'octave-smie-forward-token
               :backward-token #'octave-smie-backward-token)
   (setq-local smie-indent-basic 'octave-block-offset)
+  (add-hook 'smie-indent-functions #'octave-indent-comment nil t)
 
   (setq-local smie-blink-matching-triggers
               (cons ?\; smie-blink-matching-triggers))


reply via email to

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