GNU bug report logs - #17955
24.3.92; octave.el: indentation following ... or \

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Sun, 6 Jul 2014 09:38:02 UTC

Severity: minor

Tags: fixed

Found in version 24.3.92

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #18 received at 17955 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 17955 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>
Subject: Re: bug#17955: 24.3.92; octave.el: indentation following ... or \
Date: Sat, 29 May 2021 10:44:10 -0400
Lars Ingebrigtsen [2021-05-29 07:06:41] wrote:
> Stefan Monnier <monnier <at> 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.

I suspect this behavior, is still not quite what users would want:
why break the line if the continuation starts where you broke?
Maybe

    ('(:after . "=") (smie-rule-parent octave-block-offset))))

would work better?

And we should add tests for these changes, since regressions are all too
easy to introduce when it comes to indentation rules.


        Stefan





This bug report was last modified 3 years and 363 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.