opensubscriber
   Find in this group all groups
 
Unknown more information…

e : emacs-devel@gnu.org 27 May 2012 • 3:45AM -0400

The grand indentation unification project
by Daniel Hackney

REPLY TO AUTHOR
 
REPLY TO GROUP




While working on adding configurable lisp paths to package.el, I noticed
that many whitespace-only changes were created, cluttering up the diffs.
It would make patches smaller and more focused if there were a single
whitespace style applied throughout all of the elisp sources. This
doesn't mean radically changing things; but rather applying the current
style throughout. From what I see, the current source has
`indent-tabs-mode' non-nil and a `tab-width' of 8 and mostly sticks to
this formula.

There are some places where it deviates from this style, such as using 8
spaces rather than a tab for indentation in some parts, having a space
before a tab, or a single-semicolon comment at column 1. `indent-region'
does not catch all of these, especially indentation using 8 spaces
rather than a tab (because `indent-to' specifically avoids changing
spaces to tabs if there are the right number of spaces).

I propose adding to the `emacs-lisp-mode' section of ".dir-locals.el" in
the source root `(indent-tabs-mode . t)' and a definition for
`whitespace-style' to use tabs for indentation. Then, when committing
changes, the buffer would be run through `indent-region' and
`whitespace-cleanup'. This would ensure whitespace consistency for all
files in the repo and prevent diff conflicts which consist entirely of
whitespace changes.

As an extra guarantee of consistency, use "emacs -Q" when re-indenting
files so that no user customizations can change the indentation.

--
Daniel M. Hackney


Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.