bbatsov / emacs-lisp-style-guide

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

Automatic alignment? #3

Closed shosti closed 10 years ago

shosti commented 10 years ago

I'm wondering about all the alignment rules--since Emacs Lisp will almost always be edited from within Emacs, it seems to me that the correct alignment is always "however Emacs automatically aligns it". I think there should definitely be some rules on using declare and other ways to adjust automatic indentation (there seems to be some confusion surrounding best practices around that). I'm not even sure the other alignment rules would be necessary in that case, although they might be nice to keep as a reference.

bbatsov commented 10 years ago

While you're totally correct I've seen so much misaligned code that I'm thinking some people are actively fighting the auto-indentation. :-)

Malabarba commented 10 years ago

The amount of misaligned code inside emacs's own source files is scary! It's even misleading to read sometimes.

shosti commented 10 years ago

Those are good points, but I still think it would be good to put in "auto-align all code" as a recommendation.

bbatsov commented 10 years ago

Those are good points, but I still think it would be good to put in "auto-align all code" as a recommendation.

Definitely. I was just making a point that having concrete examples beside the general rule makes sense.