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

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

bug#64589: 30.0.50; smie-config-guess can break ruby indentation


From: Dmitry Gutov
Subject: bug#64589: 30.0.50; smie-config-guess can break ruby indentation
Date: Thu, 19 Oct 2023 23:05:54 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

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.





reply via email to

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