all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Uday S Reddy <u.s.reddy@cs.bham.ac.uk>
Cc: 5314@debbugs.gnu.org
Subject: bug#5314: 23.1; Inconsistent treatment of auto-save files
Date: Tue, 05 Jan 2010 14:28:10 -0500	[thread overview]
Message-ID: <jwvd41ol69e.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <84skalg9e3.fsf@cs.bham.ac.uk> (Uday S. Reddy's message of "Mon,  04 Jan 2010 15:47:00 +0000")

> 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






  parent reply	other threads:[~2010-01-05 19:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 15:47 bug#5314: 23.1; Inconsistent treatment of auto-save files Uday S Reddy
     [not found] ` <handler.5314.B.126270052714260.ack@debbugs.gnu.org>
2010-01-05 14:29   ` bug#5314: Acknowledgement (23.1; Inconsistent treatment of auto-save files) Uday S Reddy
2010-01-06  6:29     ` Kevin Rodgers
2010-01-06 16:08     ` Stefan Monnier
2010-01-06 16:33       ` Uday S Reddy
2016-07-17  4:29         ` Andrew Hyatt
2010-01-05 19:28 ` Stefan Monnier [this message]
2010-01-06  2:14   ` bug#5314: 23.1; Inconsistent treatment of auto-save files Uday S Reddy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvd41ol69e.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=5314@debbugs.gnu.org \
    --cc=u.s.reddy@cs.bham.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.