From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: buffer is modified after commit Date: Thu, 14 Feb 2008 08:53:40 +0100 Message-ID: <47B3F384.6080809@gmx.at> References: <47B3639E.9070007@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1202977268 5786 80.91.229.12 (14 Feb 2008 08:21:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Feb 2008 08:21:08 +0000 (UTC) Cc: Juanma Barranquero , Richard Sharman , Emacs Devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 14 09:21:26 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JPZLQ-0005xu-Qr for ged-emacs-devel@m.gmane.org; Thu, 14 Feb 2008 09:21:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JPZKw-0003YC-Pn for ged-emacs-devel@m.gmane.org; Thu, 14 Feb 2008 03:20:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JPZKs-0003Y4-7Y for emacs-devel@gnu.org; Thu, 14 Feb 2008 03:20:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JPZKq-0003Xf-0u for emacs-devel@gnu.org; Thu, 14 Feb 2008 03:20:48 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JPZKp-0003Xb-TK for emacs-devel@gnu.org; Thu, 14 Feb 2008 03:20:47 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JPZKp-0005Mh-Fm for emacs-devel@gnu.org; Thu, 14 Feb 2008 03:20:47 -0500 Original-Received: (qmail invoked by alias); 14 Feb 2008 07:54:06 -0000 Original-Received: from N760P019.adsl.highway.telekom.at (EHLO [62.47.38.243]) [62.47.38.243] by mail.gmx.net (mp003) with SMTP; 14 Feb 2008 08:54:06 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19N0NxglW5NdP84rZTH6JY+ZEvB9ZTbqCYOoe/3UZ ZoeOjf39AcfKKb User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:89054 Archived-At: > edit > save > rotate > edit > save > undo undo undo... Maybe define (defun restore-buffer-unmodified-unless-saved (arg) (when (or (and (not (buffer-file-name)) (not arg)) (and (file-exists-p (buffer-file-name)) (equal arg (nth 5 (file-attributes (buffer-file-name)))))) (restore-buffer-modified nil))) and add (setq buffer-undo-list (cons '(apply restore-buffer-unmodified-unless-saved (when (and (buffer-file-name) (file-exists-p (buffer-file-name))) (nth 5 (file-attributes (buffer-file-name))))) buffer-undo-list)) to `highlight-changes-rotate-faces', but that would constitute yet another ugly hack. What's really needed is a new entry type for `buffer-undo-list' like the (nil PROPERTY VALUE BEG . END) one but when applied not causing a change in the buffer-modified status. > By the way, I've installed a change on the 22 branch which should fix > the buffer-modified-p problem (and removes this number 3 hack). Thanks.