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

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 29 May 2021 07:06:41 +0200

Stefan Monnier <[email-masked]> 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