From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#5314: Acknowledgement (23.1; Inconsistent treatment of auto-save files) Date: Wed, 06 Jan 2010 11:08:43 -0500 Message-ID: References: <84skalg9e3.fsf@cs.bham.ac.uk> <19267.19658.406000.307675@gargle.gargle.HOWL> Reply-To: Stefan Monnier , 5314@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1262794906 6352 80.91.229.12 (6 Jan 2010 16:21:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Jan 2010 16:21:46 +0000 (UTC) Cc: 5314@debbugs.gnu.org To: Uday S Reddy Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 06 17:21:38 2010 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 1NSYdc-0002Yk-Cj for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jan 2010 17:21:36 +0100 Original-Received: from localhost ([127.0.0.1]:40161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSYdc-0006jy-My for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jan 2010 11:21:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSYb0-0005Ce-7Z for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2010 11:18:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSYav-0005Al-91 for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2010 11:18:53 -0500 Original-Received: from [199.232.76.173] (port=43654 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSYau-0005Ah-VB for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2010 11:18:48 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:32889) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NSYau-0005Cu-JQ for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2010 11:18:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NSYRS-0002hZ-RQ; Wed, 06 Jan 2010 11:09:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: Stefan Monnier , 5314@debbugs.gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Jan 2010 16:09:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5314 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5314-submit@debbugs.gnu.org id=B5314.126279413010372 (code B ref 5314); Wed, 06 Jan 2010 16:09:02 +0000 Original-Received: (at 5314) by debbugs.gnu.org; 6 Jan 2010 16:08:50 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSYRG-0002hF-9y for submit@debbugs.gnu.org; Wed, 06 Jan 2010 11:08:50 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSYRE-0002h9-V9 for 5314@debbugs.gnu.org; Wed, 06 Jan 2010 11:08:49 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtIFAPdDREvO+KPG/2dsb2JhbACBRdFihDAEiiiDCQ X-IronPort-AV: E=Sophos;i="4.49,230,1262581200"; d="scan'208";a="53158950" Original-Received: from 206-248-163-198.dsl.teksavvy.com (HELO ceviche.home) ([206.248.163.198]) by ironport2-out.pppoe.ca with ESMTP; 06 Jan 2010 11:08:43 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 8343AB4077; Wed, 6 Jan 2010 11:08:43 -0500 (EST) In-Reply-To: <19267.19658.406000.307675@gargle.gargle.HOWL> (Uday S. Reddy's message of "Tue, 5 Jan 2010 14:29:30 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) X-Spam-Score: -2.2 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -2.1 (--) Resent-Date: Wed, 06 Jan 2010 11:09:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org 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:33998 Archived-At: > The following sequence seems to always return t > (progn (set-buffer-modified-p t) (recent-auto-save-p)) Yes, that's a problem. Thanks for tracking it down. I'm looking at the corresponding code and see from where the problem comes. I should have a patch for it shortly. It's kind of a delicate issue because both the buffer-modified-p data as well as the recent-auto-save-p data are kept implicitly, basically by checking timestamps corresponding to the last (auto)save. That means that set-buffer-modified-p has to fiddle with those timestamps and lie about "when" the save took place. And since there are several such timestamps involved, a lie at one place can result in odd behaviors elsewhere, as you're seeing. > VM's quit routine had the following series of operations: > (set-buffer-modified-p nil) > (delete-auto-save-file-if-necessary) > (kill-buffer (current-buffer))) > This might have worked in some old version of Emacs. But, at present, > the delete-..-if-necessary doesn't do anything because the buffer has > been set to be unmodified. (This is reasonable behaviour for the > delete-..-if-necessary function, but it doesn't follow from the > documented description of it.) Indeed delete-auto-save-file-if-necessary claims that it only deletes it "if the file was written by this Emacs since the last real save", but in reality (set-buffer-modified-p nil) is mistaken for a "real save" (because it internally works by setting the "last save timestamp"). A real good fix to make it work reliably and obey the doc may take time. Stefan