From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Newsgroups: gmane.emacs.help Subject: Re: C/C++ mode feature I badly want... (non-persistent indentation) Date: Wed, 14 Nov 2012 11:18:18 +0000 (UTC) Message-ID: References: <1352849552.67331.YahooMailNeo@web121305.mail.ne1.yahoo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352891924 32408 80.91.229.3 (14 Nov 2012 11:18:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2012 11:18:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 14 12:18:55 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TYaze-0001D0-SF for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Nov 2012 12:18:54 +0100 Original-Received: from localhost ([::1]:45921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYazV-0005Pk-5g for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Nov 2012 06:18:45 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYazN-0005PU-Kp for help-gnu-emacs@gnu.org; Wed, 14 Nov 2012 06:18:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYazK-0001cM-I2 for help-gnu-emacs@gnu.org; Wed, 14 Nov 2012 06:18:37 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:59138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYazK-0001cB-BX for help-gnu-emacs@gnu.org; Wed, 14 Nov 2012 06:18:34 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TYazQ-00010L-Hv for help-gnu-emacs@gnu.org; Wed, 14 Nov 2012 12:18:40 +0100 Original-Received: from 94-21-222-113.pool.digikabel.hu ([94.21.222.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Nov 2012 12:18:40 +0100 Original-Received: from adatgyujto by 94-21-222-113.pool.digikabel.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Nov 2012 12:18:40 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 94.21.222.113 (Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.10) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87682 Archived-At: S Boucher 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.