unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16182: 24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens
@ 2013-12-18  3:55 Dmitry Gutov
       [not found] ` <handler.16182.B.138733895212351.ack@debbugs.gnu.org>
                   ` (4 more replies)
  0 siblings, 5 replies; 27+ messages in thread
From: Dmitry Gutov @ 2013-12-18  3:55 UTC (permalink / raw)
  To: 16182

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.





^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2013-12-22  2:01 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-18  3:55 bug#16182: 24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens Dmitry Gutov
     [not found] ` <handler.16182.B.138733895212351.ack@debbugs.gnu.org>
2013-12-18  4:05   ` bug#16182: Acknowledgement (24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens) Dmitry Gutov
2013-12-18 10:31     ` Bozhidar Batsov
2013-12-19  4:35       ` Dmitry Gutov
2013-12-19  9:08         ` Bozhidar Batsov
2013-12-19 12:54           ` Bozhidar Batsov
2013-12-19 17:15             ` Dmitry Gutov
2013-12-19 20:33               ` Bozhidar Batsov
2013-12-19 20:42                 ` Steve Purcell
2013-12-20  5:21                 ` Dmitry Gutov
2013-12-20  9:51                   ` Bozhidar Batsov
2013-12-20 11:57                     ` Dmitry Gutov
2013-12-20 15:46                       ` Bozhidar Batsov
2013-12-21 15:31                         ` Dmitry Gutov
2013-12-21 15:38                           ` Steve Purcell
2013-12-21 15:53                             ` Dmitry Gutov
2013-12-21 16:49                               ` Steve Purcell
2013-12-21 19:32                           ` Adam Doppelt
2013-12-22  2:01                             ` Dmitry Gutov
2013-12-19 13:47           ` Dmitry Gutov
2013-12-18 12:42 ` bug#16182: 24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens Stefan Monnier
2013-12-19  4:57   ` Dmitry Gutov
2013-12-19 13:47     ` Stefan Monnier
2013-12-18 17:57 ` bug#16182: Adam Sokolnicki
2013-12-19  4:48   ` bug#16182: Dmitry Gutov
2013-12-19 18:39 ` bug#16182: Adam Doppelt
2013-12-20 12:44 ` bug#16182: Adam Sokolnicki

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).