* 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 <rgm@gnu.org>
;; (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))))
+
\f
(defvar octave-font-lock-keywords
(list
: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))