Subject: bug#60186: closed (Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 30 Dec 2022 22:08:02 +0000

Your bug report

#60186: 29.0.60; ruby-mode indentation of multi-line expressions

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
60186: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60186
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#60186: 29.0.60; ruby-mode indentation of multi-line expressions
From: Dmitry Gutov <[email-masked]>
To: Aaron Jensen <[email-masked]>
Cc: [email-masked]
Date: Sat, 31 Dec 2022 00:07:16 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 29.1

On 30/12/2022 20:16, Aaron Jensen wrote:
> I can't reproduce this anymore, I think it had to do w/ dtrt-indent
> doing something odd. I had things in a state where some buffers did it
> and not others and I restarted Emacs before checking the settings. In
> any case, I think it's fine. I don't have any concerns with the patch
> as-is.

Thanks for testing, this is now in the release branch.

Subject: 29.0.60; ruby-mode indentation of multi-line expressions
From: Aaron Jensen <[email-masked]>
To: [email-masked]
Date: Sun, 18 Dec 2022 21:54:18 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Follow-up to bug#60110

I prefer rather simplictic indentation for Ruby (and this appears to be
pretty common from codebases I've seen). Essentially, the rule is: If an
expression continues on another line, indent it once. 

Current:

some_variable = some_object.
                  some_method

Desired:

some_variable = some_object.
  some_method

Current:

some_variable = some_number + some_other_number *
                              some_third_number + some_fourth_number -
                some_fifth_number

Desired:

some_variable = some_number + some_other_number *
  some_third_number + some_fourth_number -
  some_fifth_number

I don't know if this last one is related or not, but it follows the same
rule plus the rule about blocks. Everything about the continuation of
the expression is indented once. The contents of the block are indented
once more. The end should line up with the line that opened the block.

Current:

some_variable = some_array.
                  map do |x|
  x + 1
end

Desired:

some_variable = some_array.
  map do |x|
    x + 1
  end