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: 23.1; Inconsistent treatment of auto-save files Date: Tue, 05 Jan 2010 14:28:10 -0500 Message-ID: References: <84skalg9e3.fsf@cs.bham.ac.uk> 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 1262724974 12456 80.91.229.12 (5 Jan 2010 20:56:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jan 2010 20:56:14 +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 Tue Jan 05 21:56:07 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 1NSGRe-0003d2-JC for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jan 2010 21:56:03 +0100 Original-Received: from localhost ([127.0.0.1]:44649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSGRe-00052P-NT for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jan 2010 15:56:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSFOf-00067k-79 for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2010 14:48:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSFOZ-0005yI-Fa for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2010 14:48:51 -0500 Original-Received: from [199.232.76.173] (port=47469 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSFOY-0005yA-VB for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2010 14:48:47 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60320) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NSFOX-0002uQ-TD for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2010 14:48:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NSF5S-0006VE-3B; Tue, 05 Jan 2010 14:29: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: Tue, 05 Jan 2010 19:29: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.126271969624986 (code B ref 5314); Tue, 05 Jan 2010 19:29:02 +0000 Original-Received: (at 5314) by debbugs.gnu.org; 5 Jan 2010 19:28:16 +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 1NSF4i-0006Ux-Hw for submit@debbugs.gnu.org; Tue, 05 Jan 2010 14:28:16 -0500 Original-Received: from tomts16.bellnexxia.net ([209.226.175.4] helo=tomts16-srv.bellnexxia.net) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSF4h-0006Ur-5E for 5314@debbugs.gnu.org; Tue, 05 Jan 2010 14:28:15 -0500 Original-Received: from toip5.srvr.bell.ca ([209.226.175.88]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20100105192810.BUQN11823.tomts16-srv.bellnexxia.net@toip5.srvr.bell.ca> for <5314@debbugs.gnu.org>; Tue, 5 Jan 2010 14:28:10 -0500 Original-Received: from bas1-montreal42-1178030923.dsl.bell.ca (HELO ceviche.home) ([70.55.83.75]) by toip5.srvr.bell.ca with ESMTP; 05 Jan 2010 14:28:57 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 2D8BFB4077; Tue, 5 Jan 2010 14:28:10 -0500 (EST) In-Reply-To: <84skalg9e3.fsf@cs.bham.ac.uk> (Uday S. Reddy's message of "Mon, 04 Jan 2010 15:47:00 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -1.4 (-) Resent-Date: Tue, 05 Jan 2010 14:29: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:33959 Archived-At: > Hi, I am a maintainer of VM. [ Always glad to see people from my field participate in Emacs development. ] > 1. If there is an old auto-save file, and you visit the file, make > some changes and kill the buffer without saving, then the old > auto-save file is silently deleted. That's bad! But I cannot reproduce it here: % emacs23 -Q ~/tmp/foo.test [type...type...type...] % l ~/tmp/\#foo.test\# -rw-r--r-- 1 monnier monnier 259 jan 5 14:06 /home/monnier/tmp/#foo.test# [kill Emacs] % emacs23 -Q ~/tmp/foo.test [type a little something to modify the buffer] C-x k RET % l ~/tmp/\#foo.test\# -rw-r--r-- 1 monnier monnier 259 jan 5 14:06 /home/monnier/tmp/#foo.test# Could you try and provide a more precise recipe? Or maybe the old auto-save file was overwritten by a new auto-save file before you killed the buffer? It does sound like a likely reason. And indeed it's a problem, tho I'm not sure how to best fix it: - We could try and rename the old auto-save file before saving the new one and let recover-file choose among the various possible auto-save files. - Maybe make it harder for the user to start modifying the buffer when there's an old auto-save file (e.g. make the buffer read-only and warn/prompt when the user tries to C-x C-q). - Prompt just before saving the new auto-save file so the user gets a chance to prevent the old auto-save from being overwritten. - Disable auto-saving when there's an old auto-save file (together with an appropriate warning, in the same way as we disable auto-saving when the file/buffer got much smaller). > 2. The inline documentation for delete-auto-save-file-if-necessary > says "Normally delete only if the file was written by this Emacs since > the last real save". This gives one the impression that Emacs is > keeping track of when the last real save was done, but in reality it > only seems to be checking the buffer-modified-p status. If so, a more > accurate way to word the doc string might be If the behavior doesn't match the docstring, I think the problem would be in the code rather than in the doc. AFAICT the code doesn't just check buffer-modified-p but really checks whether the current buffer has been auto-saved. > If the buffer-modified-p is nil, then even recent auto-save files seem > to be left lying around. This is the opposite problem of that in > point 1. I cannot reproduce this either. Do you have a recipe? > 4. The Elisp manual descriptions for > delete-auto-save-file-if-necessary and > recent-auto-save-p need to be similarly modified. Just to be sure: do you want to change the doc because you don't like the behavior it describes, or because it doesn't match the behavior you see? We clearly would rather fix the code to match the doc if the doc describes the behavior we want. Stefan