unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* C/C++ mode feature I badly want... (non-persistent indentation)
@ 2012-11-13 23:32 S Boucher
  2012-11-14 11:18 ` Tom
  0 siblings, 1 reply; 3+ messages in thread
From: S Boucher @ 2012-11-13 23:32 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

I seem to often run into code with what I call random indentation.

Because it is in source control, it's a can of worm to re-indent everything and submit the code properly formatted (just makes it harder to look at history afterward, and it doesn't help when people mess the formatting again after...)

(let ((non-persistent-formatting t))
   (indent-region (point-min) (point-max)))

Would indent the lines, but instead of actually changing the buffer, it would put a display property over the leading white spaces, where the text in the property corresponds to the correct indentation.

The rest of the time, (when non-persistent-formatting is nil), then it removes the display property on the leading white spaces, and modifies the line the normal way.

In this way, I can actually understand the file without causing chaos in the source repository.

I think that would be a killer feature.  That's my .02$.

[-- Attachment #2: Type: text/html, Size: 1133 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-14 11:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-13 23:32 C/C++ mode feature I badly want... (non-persistent indentation) S Boucher
2012-11-14 11:18 ` Tom
2012-11-14 11:50   ` Tassilo Horn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).