GNU bug report logs - #64589
30.0.50; smie-config-guess can break ruby indentation

Previous Next

Package: emacs;

Reported by: Aaron Jensen <aaronjensen <at> gmail.com>

Date: Thu, 13 Jul 2023 04:21:01 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Aaron Jensen <aaronjensen <at> gmail.com>, 64589 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Subject: bug#64589: 30.0.50; smie-config-guess can break ruby indentation
Date: Thu, 19 Oct 2023 23:05:54 +0300
Hi Aaron,

On 13/07/2023 07:20, Aaron Jensen wrote:
> In repro.rb:
> 
> def some_method
>    return some_other_method(
>      some_argument
>    )
> end
> 
> emacs -Q repro.rb
> M-x smie-config-guess
> 
> Type:
> 
> foo(
> x
> )
> 
> The x will not be indented. If smie-config-guess is omitted, it indents
> as expected.

Sorry about the late reply.

But it seems like this feature might be incompatible with the relatively 
complex way the ruby-mode indentation is written (the comments inside 
'smie-config--guess' seem to indicate so). So while it does sound cool 
to be able to use style detection, it might only work okay for certain 
languages/indentation rules.

One thing to note, though, is that it seems to want larger files, to be 
able to "learn" from more cases. But when I provide a larger file, it 
usually ends up saying "Nothing to change", even if some lines are 
indented differently from the current config. E.g. if I just expand your 
example to:

  def some_method
    return some_other_method(
      some_argument
    )

    foo(
      bar,
      tee
    )
  end

then adding foo(<RET> at the end indents predictably okay.

Perhaps Stefan as the author could tell us whether it's at all feasible 
to adjust ruby-mode to be more compatible with smie-config-guesser, or 
whether there could be some low-hanging fruit in the latter to help.




This bug report was last modified 1 year and 335 days ago.

Previous Next


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