help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C/C++ mode feature I badly want... (non-persistent indentation)


From: Tom
Subject: Re: C/C++ mode feature I badly want... (non-persistent indentation)
Date: Wed, 14 Nov 2012 11:18:18 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

S Boucher <stbya <at> yahoo.com> writes:

> 
> 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.

If you know some elisp then it's not hard to create a simple solution for
this. The elisp would reindent the whole buffer for each new file it
encounters, but it would not save it, just check where the whitespace
at the beginning of lines differs from the original file and then revert
the reindentation and add the display properties as necessary.

It should cache this whitespace info for each file, so if the same file
is encountered then its indentation could be fixed quickly using the
cached information. Cache validity could be tested by comparing cache
date to the file modification and if the file changes then its cache
info would be updated.

It does not seem too dificult and I imagine lots of people woould find 
it useful. It really does seem like a useful idea.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]