From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reindert-Jan Ekker Newsgroups: gmane.emacs.bugs Subject: Re: highlight-changes-rotate-faces sets buffer modified flag Date: Wed, 9 May 2007 11:29:58 +0200 (CEST) Message-ID: References: <46401465.4050803@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: sea.gmane.org 1178730243 16732 80.91.229.12 (9 May 2007 17:04:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 9 May 2007 17:04:03 +0000 (UTC) Cc: R.Ekker@ai.rug.nl, bug-gnu-emacs@gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 09 19:04:01 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hlpa5-0002Px-Ia for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 May 2007 19:04:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HlphI-0002Mj-Nj for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 May 2007 13:11:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hlic3-0000xt-FZ for bug-gnu-emacs@gnu.org; Wed, 09 May 2007 05:37:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hlic1-0000ve-8v for bug-gnu-emacs@gnu.org; Wed, 09 May 2007 05:37:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hliby-0000vE-PM for bug-gnu-emacs@gnu.org; Wed, 09 May 2007 05:37:31 -0400 Original-Received: from tcw2.ai.rug.nl ([129.125.178.237]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HliUm-00006B-KD for bug-gnu-emacs@gnu.org; Wed, 09 May 2007 05:30:04 -0400 Original-Received: from tcw2.ai.rug.nl (tcw2.ai.rug.nl [129.125.178.237]) by tcw2.ai.rug.nl (8.13.8/8.13.8) with ESMTP id l499Twtj006158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 May 2007 11:29:58 +0200 In-Reply-To: <46401465.4050803@gmx.at> X-Virus-Scanned: ClamAV 0.88.7/3223/Wed May 9 01:17:59 2007 on tcw2.ai.rug.nl X-Virus-Status: Clean X-detected-kernel: Genre and OS details not recognized. X-Mailman-Approved-At: Wed, 09 May 2007 13:10:57 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:15700 Archived-At: Hi, Turning off highlight-changes-mode sets the buffer-modified state as well. By the way, I do not have a lot of experience with emacs lisp. Regarding buffer-undo-list: would it be correct to just remove the front element of the list in the advice I wrote? With regards, Reindert On Tue, 8 May 2007, martin rudalics wrote: >> Running the function highlight-changes-rotate-faces sets the buffer's >> modified flag. It seems to me that this should not happen, since only >> some faces are changed. > > Thank you for sending a report on this. In principle a "face change" > may change the buffer-modified state and can be undone as well. In the > present case I agree with you that the buffer-modified state should not > change. I believe that most of theses face changes were obscured by > changes in the buffer text, hence probably people didn't notice. > >> As a workaround, I use the following advice: >> >> >> ;; advice for highlight-changes-rotate-faces >> ;; so that it does not change the modified flag for the buffer >> (defadvice highlight-changes-rotate-faces (around around-rotate-faces) >> (let ((was-modified (buffer-modified-p))) >> ad-do-it >> (unless was-modified >> (set-buffer-modified-p nil)))) >> (ad-activate 'highlight-changes-rotate-faces) > > You proably do not want adding an entry to `buffer-undo-list' either. > >> >> >> The version string of my emacs: >> "GNU Emacs 21.3.1 (i386-mingw-nt5.1.2600) of 2004-03-10 on NYAUMO" > > AFAICT this problem is still present in Emacs 22. In addition, it seems > to me that turning off `highlight-changes-mode' may set the > buffer-modified state as well. Could you please verify this on your > system? >