GNU bug report logs - #15902
24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")

Previous Next

Package: emacs;

Reported by: "Sebastien Vauban" <sva-news <at> mygooglest.com>

Date: Fri, 15 Nov 2013 11:25:02 UTC

Severity: wishlist

Tags: wontfix

Found in version 24.3.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15902 in the body.
You can then email your comments to 15902 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15902; Package emacs. (Fri, 15 Nov 2013 11:25:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Sebastien Vauban" <sva-news <at> mygooglest.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 15 Nov 2013 11:25:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
 Auto-save file not deleted when quitting Emacs (and saying "don't
 save")
Date: Fri, 15 Nov 2013 12:23:38 +0100
Hello,

If I modify some file, then quit Emacs, I'm reminded that I have an unsaved
buffer:

    Modified buffers exist; exit anyway?

I answer "yes".

In a new Emacs session, when opening that same file, Emacs tells me I have to
recover it. Quite confusing!?

Cause: the Auto-save file (#file#) hasn't been deleted by Emacs after having
explicitly having said: "No, I don't want to keep those modifications to my
file, throw them away".

Demo: http://screencast.com/t/wqlowzEM.

Best regards,
  Seb

-- 
Sebastien Vauban




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15902; Package emacs. (Fri, 15 Nov 2013 11:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 15902 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sebastien Vauban <sva-news <at> mygooglest.com>
Cc: 15902 <at> debbugs.gnu.org
Subject: Re: bug#15902: 24.3.50;
 Auto-save file not deleted when quitting Emacs (and saying
 "don't	save")
Date: Fri, 15 Nov 2013 13:50:04 +0200
> From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
> Date: Fri, 15 Nov 2013 12:23:38 +0100
> 
> If I modify some file, then quit Emacs, I'm reminded that I have an unsaved
> buffer:
> 
>     Modified buffers exist; exit anyway?
> 
> I answer "yes".
> 
> In a new Emacs session, when opening that same file, Emacs tells me I have to
> recover it. Quite confusing!?
> 
> Cause: the Auto-save file (#file#) hasn't been deleted by Emacs after having
> explicitly having said: "No, I don't want to keep those modifications to my
> file, throw them away".

No, you did NOT say that you want to throw away your modifications.
You just said that you want to exit right away, even though you have
modifications.  Emacs just makes you a service by keeping them, just
in case of "oops".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15902; Package emacs. (Fri, 15 Nov 2013 12:21:01 GMT) Full text and rfc822 format available.

Message #11 received at 15902 <at> debbugs.gnu.org (full text, mbox):

From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15902 <at> debbugs.gnu.org
Subject: Re: bug#15902: 24.3.50;
 Auto-save file not deleted when quitting Emacs (and saying
 "don't	save")
Date: Fri, 15 Nov 2013 13:19:54 +0100
Eli Zaretskii wrote:
>> From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
>> Date: Fri, 15 Nov 2013 12:23:38 +0100
>> 
>> If I modify some file, then quit Emacs, I'm reminded that I have an unsaved
>> buffer:
>> 
>>     Modified buffers exist; exit anyway?
>> 
>> I answer "yes".
>> 
>> In a new Emacs session, when opening that same file, Emacs tells me I have to
>> recover it. Quite confusing!?
>> 
>> Cause: the Auto-save file (#file#) hasn't been deleted by Emacs after having
>> explicitly having said: "No, I don't want to keep those modifications to my
>> file, throw them away".
>
> No, you did NOT say that you want to throw away your modifications.
> You just said that you want to exit right away, even though you have
> modifications.  Emacs just makes you a service by keeping them, just
> in case of "oops".

I understand the question "do you want to exit anyway (while you have unsaved
things)" as "be cautious: you'll loose your modifications".

In a way, it's nice that Emacs does keep the file in case of, but what's
annoying is that you can't easily go on with the editing of your file, from
where you left it saved: you (have to) see the message "please recover your
file" (while the file wasn't damaged at the first place), and then decide what
to do.

And, from there, it's possible I'm not aware of the right way, but:

- I don't (always) know how to make the right choice: I see what I have, not
  what I'll get if I "recover" the file

- what I do, if I know I don't want to recover, is go to Dired, delete
  the #file#, kill the buffer containing file, and reopen the file. This time,
  no message, everything's as I expected. I can go on editing my file.

I can be convinced there is no real right or wrong way between the two
behaviors (the current, and the one I was asking for), but I instinctively
consider mine as being closer the what the user expected.

Anyway, if you say that the current way is the correct one, I'll still find
this weird, but you can safely close the bug.

Best regards,
  Seb

-- 
Sebastien Vauban




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15902; Package emacs. (Fri, 15 Nov 2013 14:06:01 GMT) Full text and rfc822 format available.

Message #14 received at 15902 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Sebastien Vauban" <sva-news <at> mygooglest.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 15902 <at> debbugs.gnu.org
Subject: Re: bug#15902: 24.3.50;
 Auto-save file not deleted when quitting Emacs (and saying
 "don't	save")
Date: Fri, 15 Nov 2013 09:05:14 -0500
> where you left it saved: you (have to) see the message "please recover
> your file" (while the file wasn't damaged at the first place), and
> then decide what to do.

Indeed, you have to see a message.  And after seeing this message,
you obviously have to decide what to do with it.  One option is to
simply disregard the message and move on.  The message doesn't tell you
that you *have* to recover the file.
It says "%s has auto save data; consider M-x recover-this-file" to remind
you about the existence of this auto-save data, in case you didn't know
or forgot about it.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15902; Package emacs. (Fri, 15 Nov 2013 14:28:02 GMT) Full text and rfc822 format available.

Message #17 received at 15902 <at> debbugs.gnu.org (full text, mbox):

From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 15902 <at> debbugs.gnu.org
Subject: Re: bug#15902: 24.3.50;
 Auto-save file not deleted when quitting Emacs (and saying
 "don't	save")
Date: Fri, 15 Nov 2013 15:26:56 +0100
Stefan Monnier wrote:
>> where you left it saved: you (have to) see the message "please recover
>> your file" (while the file wasn't damaged at the first place), and
>> then decide what to do.
>
> Indeed, you have to see a message.  And after seeing this message,
> you obviously have to decide what to do with it.  One option is to
> simply disregard the message and move on.  The message doesn't tell you
> that you *have* to recover the file.
> It says "%s has auto save data; consider M-x recover-this-file" to remind
> you about the existence of this auto-save data, in case you didn't know
> or forgot about it.

The message "%s has auto save data; consider M-x recover-this-file" is useful
for modifications which I could potentially loose because of an Emacs crash, a
power failure, a kill -9 of Emacs, and so on... No doubt about the usefulness
of the auto-save feature.

My point is just that, when I quit Emacs and answer a full "yes" (even the
3-char version of the prompt!) to say that _I don't want my modifications to be
saved_, I prefer not be bothered, later, by that message and those questions
about what to do in that particular case.

For example, when I open some files after 3 weeks, how will I know that, for
some of them, I explicitly disregarded the changes when leaving Emacs (and
should ignore the message), while, for others, I did not intend to loose the
modifications, and I would need to recover them?

Best regards,
  Seb

-- 
Sebastien Vauban




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15902; Package emacs. (Sat, 16 Nov 2013 01:19:02 GMT) Full text and rfc822 format available.

Message #20 received at 15902 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Sebastien Vauban" <sva-news <at> mygooglest.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 15902 <at> debbugs.gnu.org
Subject: Re: bug#15902: 24.3.50; Auto-save file not deleted when
 quitting Emacs (and saying "don't save")
Date: Fri, 15 Nov 2013 20:18:14 -0500
> For example, when I open some files after 3 weeks, how will I know that, for
> some of them, I explicitly disregarded the changes when leaving Emacs (and
> should ignore the message), while, for others, I did not intend to loose the
> modifications, and I would need to recover them?

Of course, it's a tradeoff.  We could let the user choose between "exit
with auto-save" and "exit without auto-save".  But along with "save
& exit" that would make it a 3-way answer, so it would make it
more complex than the simple yes/or question we have now.

Note also that if you don't know whether it's worth recovering, you can
just try it out, then look at the resulting unsaved changes (via
diff-buffer-with-file).

This design is based on the assumption that the usually will usually know if
recovery is useful.  If that's the case, then Emacs's behavior is very
convenient, providing safe defaults without getting in the way.  But if
that's not the case, then indeed it's not perfect, but I think it's
still fairly good.

Another options it to use M-~ before exiting when you know that you
don't want to keep the changes: that should get you rid of both the
prompt and the auto-save file.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15902; Package emacs. (Sat, 16 Nov 2013 20:17:02 GMT) Full text and rfc822 format available.

Message #23 received at 15902 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: "Sebastien Vauban" <public-sva-news-D0wtAvR13HarG/iDocfnWg <at> plane.gmane.org>
Cc: public-15902-ubl+/3LiMTaZdePnXv/OxA <at> plane.gmane.org
Subject: Re: bug#15902: 24.3.50;
 Auto-save file not deleted when quitting Emacs (and saying "don't
 save")
Date: Sat, 16 Nov 2013 21:15:42 +0100

"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg <at> public.gmane.org>
writes:

>     Modified buffers exist; exit anyway?
>
> I answer "yes".

FWIW, I (almost) never answer yes in that situation, because I don't
know which buffers are modified (or worse : I probably think I know, and
I might be wrong). So I usually say "no", then navigate through each
"unmodified" buffer (using an #emacs provided command, see below) and
act there.

Here's the mentionned defun :

(defun select-next-modified-buffer ()
  "Select next modified (unsaved) buffer."
  ;; 2012-09-24 22:40 <jlf>  (#emacs on freenode)
  (interactive)
  (let ((modified-buffers
         (remove-if-not (lambda (buf) (and
                                       (buffer-file-name buf) (buffer-modified-p buf)))
                        (buffer-list))))
    (if modified-buffers
        (switch-to-buffer (first modified-buffers))
      (message "No modified file-visiting buffers!"))))

-- 
Nico.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15902; Package emacs. (Sun, 17 Nov 2013 15:18:02 GMT) Full text and rfc822 format available.

Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: gnu-emacs-bug <at> moderators.isc.org
Subject: Re: bug#15902: 24.3.50;
 ?Auto-save file not deleted when quitting Emacs (and saying
 "don't?save")
Date: Sun, 17 Nov 2013 15:17:00 +0000 (UTC)
Hi, Nicolas.

Nicolas Richard <theonewiththeevillook <at> yahoo.fr> wrote:


> "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg <at> public.gmane.org>
> writes:

>>     Modified buffers exist; exit anyway?
>>
>> I answer "yes".

> FWIW, I (almost) never answer yes in that situation, because I don't
> know which buffers are modified (or worse : I probably think I know, and
> I might be wrong). So I usually say "no", then navigate through each
> "unmodified" buffer (using an #emacs provided command, see below) and
> act there.

> Here's the mentionned defun :

> (defun select-next-modified-buffer ()
>  "Select next modified (unsaved) buffer."
>  ;; 2012-09-24 22:40 <jlf>  (#emacs on freenode)
>  (interactive)
>  (let ((modified-buffers
>         (remove-if-not (lambda (buf) (and
>                                       (buffer-file-name buf) (buffer-modified-p buf)))
>                        (buffer-list))))
>    (if modified-buffers
>        (switch-to-buffer (first modified-buffers))
>      (message "No modified file-visiting buffers!"))))

As a matter of interest, you might find the command `save-some-buffers' (C-x s)
useful here.  It takes you on a tour of all unsaved buffers, prompting you
whether or not to save each one.

> Nico.

-- 
Alan Mackenzie (Nuremberg, Germany).





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15902; Package emacs. (Sun, 18 Aug 2019 17:46:02 GMT) Full text and rfc822 format available.

Message #29 received at 15902 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Sebastien Vauban <sva-news <at> mygooglest.com>, Eli Zaretskii <eliz <at> gnu.org>,
 15902 <at> debbugs.gnu.org
Subject: Re: bug#15902: 24.3.50; Auto-save file not deleted when quitting
 Emacs (and saying "don't save")
Date: Sun, 18 Aug 2019 19:45:36 +0200
tags 15902 + wontfix
close 15902
quit

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> For example, when I open some files after 3 weeks, how will I know that, for
>> some of them, I explicitly disregarded the changes when leaving Emacs (and
>> should ignore the message), while, for others, I did not intend to loose the
>> modifications, and I would need to recover them?
>
> Of course, it's a tradeoff.  We could let the user choose between "exit
> with auto-save" and "exit without auto-save".  But along with "save
> & exit" that would make it a 3-way answer, so it would make it
> more complex than the simple yes/or question we have now.
>
> Note also that if you don't know whether it's worth recovering, you can
> just try it out, then look at the resulting unsaved changes (via
> diff-buffer-with-file).
>
> This design is based on the assumption that the usually will usually know if
> recovery is useful.  If that's the case, then Emacs's behavior is very
> convenient, providing safe defaults without getting in the way.  But if
> that's not the case, then indeed it's not perfect, but I think it's
> still fairly good.
>
> Another options it to use M-~ before exiting when you know that you
> don't want to keep the changes: that should get you rid of both the
> prompt and the auto-save file.

I think what Stefan says is reasonable, and since we don't want to
change the current behaviour, I'm closing this as wontfix.

If anyone disagrees with that, please re-open this bug report.

Thanks,
Stefan Kangas




Added tag(s) wontfix. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 18 Aug 2019 17:46:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 15902 <at> debbugs.gnu.org and "Sebastien Vauban" <sva-news <at> mygooglest.com> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 18 Aug 2019 17:46:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 16 Sep 2019 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 195 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.