bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#17955: 24.3.92; octave.el: indentation following ... or \


From: Lars Ingebrigtsen
Subject: bug#17955: 24.3.92; octave.el: indentation following ... or \
Date: Sat, 29 May 2021 07:06:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> So you should be able to control indentation of "b" above by tweaking
> the (:after . "=") or (:before . "=") rule.

I've never played around with the SMIE indentation before, but looking
at other examples, I came up with this:

diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index a1a5192ee1..5d877fc6ba 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -460,7 +460,8 @@ octave-smie-rules
          (smie-rule-parent octave-block-offset)
        ;; For (invalid) code between switch and case.
        ;; (if (smie-rule-parent-p "switch") 4)
-       nil))))
+       nil))
+    ('(:after . "=") octave-block-offset)))
 
 (defun octave-indent-comment ()
   "A function for `smie-indent-functions' (which see)."

And the results look OK to me:

a = \
    b
foo = \
      dasd

So I've pushed this to Emacs 28; feel free to tweak further.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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