GNU bug report logs - #54702
29.0.50; ruby-mode indentation: endless methods

Previous Next

Package: emacs;

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

Date: Mon, 4 Apr 2022 02:04:02 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Aaron Jensen <aaronjensen <at> gmail.com>
Cc: 54702 <at> debbugs.gnu.org
Subject: bug#54702: 29.0.50; ruby-mode indentation: endless methods
Date: Fri, 16 Dec 2022 02:33:17 +0200
[Message part 1 (text/plain, inline)]
Hi Aaron,

Sorry for the long pause. You said you're using something else, though, 
so it didn't seem urgent (and I've yet to encounter endless methods at 
$day_job, FWIW).

On 28/04/2022 02:58, Aaron Jensen wrote:
> On Tue, Apr 26, 2022 at 10:44 PM Dmitry Gutov <dgutov <at> yandex.ru> wrote:
>> Thanks for the report.
>>
>> I'll work on this further, but here's a quick-and-dirty patch to fix the
>> indentation problems.
> 
> Great, thank you. I've since moved back to enh-ruby-mode and I was
> able to patch it to support this (though that project appears to be
> currently not accepting contributions).

Not a problem for me, but could you test the attached patch anyway?

It seems to handle a bunch of different/complex cases fine without 
regressions, but it's always better with a second pair of eyes.

> I'd probably use ruby-mode if
> it supported indenting long parameter/argument lists the way the
> non-smie version does, like this:
> 
> def some_method(
>    some_param,
>    some_other_param
> )

Now that the SMIE stuff is again in my short-term memory, it shouldn't 
be too hard. Just please file a separate bug report (slash feature 
request) with a precise example. Bonus points for linking to a relevant 
Rubocop rule, so that we can pick a better name for the new user option.

I don't see the non-SMIE version indenting it like this -- it looks more 
like this instead (and only if I set ruby-deep-indent-paren to nil):

def test2 (
    asd,
    asd
    asd
    )

So let's start with a couple of good examples.

> I believe I've seen you imply concerns about enh-ruby-mode -- do you
> have any aside from the fact that it's not in core and it requires a
> ruby process? It's mostly worked well for me, but I don't know what I
> don't know.

My main problem with it is the spotty maintenance like in this example: 
https://github.com/zenspider/enhanced-ruby-mode/issues/96

But it might work fine for many people. Especially those who don't use Robe.

Some previous versions of it (probably by the previous maintainer) were 
really broken, so I just took up ruby-mode instead. I haven't tried 
using its latest versions much.
[ruby-endless-methods.diff (text/x-patch, attachment)]

This bug report was last modified 2 years and 214 days ago.

Previous Next


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