emacs-lisp-style-guide icon indicating copy to clipboard operation
emacs-lisp-style-guide copied to clipboard

Body on the same line as a conditional form

Open deb0ch opened this issue 9 years ago • 2 comments

I'm wondering if there should be a convention for two other kinds of cases:

(when something do-something)

versus

(when something
  do-something)

or, as another case to be discussed separately:

(if foo bar baz)

versus

(if foo
    bar
  baz)

One might want to do that to save on lines when the condition and the body are short enough.

Should it be allowed, recommended, to avoid, forbidden, up to the writer ?

deb0ch avatar Dec 04 '16 12:12 deb0ch

From what I've seen, it's a matter of taste.

xiongtx avatar Apr 01 '17 20:04 xiongtx

What I really dislike is when if is in a "mixed" format

(if foo bar
  baz)

This is quite difficult to read. Oneliner is fine with me for "short" forms, but I try to avoid the above.

Fuco1 avatar Aug 15 '18 15:08 Fuco1