bbatsov / emacs-lisp-style-guide

A community-driven Emacs Lisp style guide
1.08k stars 53 forks source link

Body on the same line as a conditional form #41

Open deb0ch opened 7 years ago

deb0ch commented 7 years ago

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 ?

xiongtx commented 7 years ago

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

Fuco1 commented 6 years ago

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.