all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

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.