GNU bug report logs - #16182
24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Wed, 18 Dec 2013 03:56:02 UTC

Severity: minor

Found in version 24.3.50

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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#16182: closed (Re: bug#16182: Acknowledgement (24.3.50;
 ruby-mode: Indentation style of multiline literals with hanging open paren
 inside other parens))
Date: Sun, 22 Dec 2013 02:02:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#16182: 24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens

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 16182 <at> debbugs.gnu.org.

-- 
16182: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16182
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Adam Doppelt <amd <at> gurge.com>
Cc: Steve Purcell <steve <at> sanityinc.com>, 16182-done <at> debbugs.gnu.org,
 Bozhidar Batsov <bozhidar <at> batsov.com>,
 Adam Sokolnicki <adam.sokolnicki <at> gmail.com>
Subject: Re: bug#16182: Acknowledgement (24.3.50; ruby-mode: Indentation style
 of multiline literals with hanging open paren inside other parens)
Date: Sun, 22 Dec 2013 04:01:12 +0200
On 21.12.2013 21:32, Adam Doppelt wrote:
> I think 'ruby-align-to-stmt-keywords' is a perfectly fine name, btw.

Ah, okay then. Without an overwhelming support for a rename, the current 
name stays.

Thanks everyone, I'm closing this bug now. It has veered off to the 
side, but for now the answer to the original question is no, with only 
one vote in favor. Let's maybe revisit it again sometime.

[Message part 3 (message/rfc822, inline)]
From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
 ruby-mode: Indentation style of multiline literals with hanging open
 paren inside other parens
Date: Wed, 18 Dec 2013 05:55:19 +0200
Judging by the open source code, it's not overly popular, but there's a
definite tendency to align literals in these kind of examples to the
beginning of the statement, not to the opening paren that contains them
(which is what ruby-mode does now, as long as there is any text after
the opening round paren):

https://github.com/intridea/grape/blob/master/README.md#basic-usage

  Status.create!({
    user: current_user,
    text: params[:status]
  })

https://github.com/intridea/grape/blob/master/lib/grape/endpoint.rb#L79

  methods.each do |method|
    route_set.add_route(self, {
      path_info: route.route_compiled,
      request_method: method,
    }, route_info: route)
  end

The code is the trunk indents the second example like this:

  methods.each do |method|
    route_set.add_route(self, {
                          path_info: route.route_compiled,
                          request_method: method,
                        }, route_info: route)
  end

Which is the preferred style? Should ruby-mode support both?

The former style looks more compact, but it can also make the arguments
following the "de-indented" literal look a bit out of place.



This bug report was last modified 11 years and 247 days ago.

Previous Next


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