dylan-lang / dylan-emacs-support

Emacs mode for indenting and highlighting Dylan code
GNU General Public License v2.0
27 stars 8 forks source link

de-indent for Newline immediately following "(" #31

Open cgay opened 5 years ago

cgay commented 5 years ago

What we have now:

let foo = really-long-function-name(
                                    long-argument-1(),
                                    long-argument-2())

What I want:

let foo = really-long-function-name(
             long-argument-1(),
             long-argument-2())

Note, never this:

let foo = really-long-function-name(argument-0-on-same-line(),
             long-argument-1(),
             long-argument-2())

If there's an argument immediately following the open paren then subsequent args should line up under the first (as they do currently):

let foo = really-long-function-name(long-argument-1(),
                                    long-argument-2())
waywardmonkeys commented 5 years ago

Another language has gone for not doing things that line up like your last example ... that way, people can use non-monospace fonts if they like!

cgay commented 5 years ago

Do not want.

cgay commented 5 years ago

There's also a fair amount of this style, and Peter Housel prefers it over my first choice above:

let foo = really-long-function-name
              (long-argument-1(),
               long-argument-2())

and I think it should be possible to support both styles depending on whether the open paren is (a) preceded by all whitespace or (b) followed by only whitespace and comments.

cgay commented 1 year ago

I recently learned the term for what I want, and it is https://github.com/google/google-java-format/wiki/The-Rectangle-Rule