[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Quitting `save-buffer' loses backup file
From: |
Sven Joachim |
Subject: |
Re: Quitting `save-buffer' loses backup file |
Date: |
Thu, 29 Dec 2005 14:00:15 +0100 |
User-agent: |
Mozilla Thunderbird 1.0.7 (X11/20051017) |
Richard M. Stallman wrote:
I am going through mail that I failed to deal with earlier.
Please forgive the delay.
$ echo "foo" > bar ; cp bar bar~
$ emacs -Q -f view-hello-file bar
In Emacs, in the "bar" buffer, type
M-x insert-buffer RET
C-x C-s
Emacs should display a '*Warning*' buffer now; type C-g to quit.
Now `buffer-backed-up' is t, but the backup file bar~ is gone. :-(
When I try it, I find that bar~ exists but bar is gone.
And buffer-backed-up is nil.
Humm. This does not look quite right either. In which directory did you
try this? It makes a difference if you try in your
temporary-file-directory, since Emacs does not make backups there.
Does it still fail for you the same as before?
As of the latest Debian snapshot (dated 2005-12-21), yes. Has anybody
worked on it since then?
Because there had been no response here, I reported the issue to the
Debian bug tracking system and had an interesting discussion with
Romain which can be found at http://bugs.debian.org/343705.
Here is a summary of what Emacs does in the scenario:
(a) Before saving bar, Emacs renames bar to bar~, overwriting the old
backup in the process, and sets `buffer-backed-up' to t. This is
documented in the manual.
(b) Emacs tries to save bar but fails to do so, because the user quits.
To reduce harm, Emacs renames bar~ back to bar. But -- and this is
probably wrong -- Emacs does not set `buffer-backed-up' back to nil.