all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Hackney <dan@haxney.org>
To: emacs-devel@gnu.org
Subject: The grand indentation unification project
Date: Sat, 26 May 2012 15:45:47 -0400	[thread overview]
Message-ID: <CAMqXDZvbW_K1D4yLAAuJOOzaChY=rd14Hk9yYsWD4jrdf9bY0A@mail.gmail.com> (raw)

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



             reply	other threads:[~2012-05-26 19:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-26 19:45 Daniel Hackney [this message]
2012-05-26 20:05 ` The grand indentation unification project Glenn Morris
2012-05-27  9:28   ` Juri Linkov
2012-05-27 14:42   ` Daniel Hackney
2012-05-27 17:13     ` Miles Bader
2012-05-27 17:32       ` Daniel Hackney
2012-05-28  5:12         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMqXDZvbW_K1D4yLAAuJOOzaChY=rd14Hk9yYsWD4jrdf9bY0A@mail.gmail.com' \
    --to=dan@haxney.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.