unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: S Boucher <stbya@yahoo.com>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: C/C++ mode feature I badly want... (non-persistent indentation)
Date: Tue, 13 Nov 2012 15:32:32 -0800 (PST)	[thread overview]
Message-ID: <1352849552.67331.YahooMailNeo@web121305.mail.ne1.yahoo.com> (raw)

[-- 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 --]

             reply	other threads:[~2012-11-13 23:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-13 23:32 S Boucher [this message]
2012-11-14 11:18 ` C/C++ mode feature I badly want... (non-persistent indentation) Tom
2012-11-14 11:50   ` Tassilo Horn

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=1352849552.67331.YahooMailNeo@web121305.mail.ne1.yahoo.com \
    --to=stbya@yahoo.com \
    --cc=help-gnu-emacs@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.
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).