unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")
@ 2013-11-15 11:23 Sebastien Vauban
  2013-11-15 11:50 ` Eli Zaretskii
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Sebastien Vauban @ 2013-11-15 11:23 UTC (permalink / raw)
  To: 15902-ubl+/3LiMTaZdePnXv/OxA

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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")
  2013-11-15 11:23 bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save") Sebastien Vauban
@ 2013-11-15 11:50 ` Eli Zaretskii
       [not found]   ` <83eh6hj34j.fsf-mXXj517/zsQ@public.gmane.org>
  2013-11-16 20:15 ` Nicolas Richard
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2013-11-15 11:50 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: 15902

> From: "Sebastien Vauban" <sva-news@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".





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")
       [not found]   ` <83eh6hj34j.fsf-mXXj517/zsQ@public.gmane.org>
@ 2013-11-15 12:19     ` Sebastien Vauban
  2013-11-15 14:05       ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Sebastien Vauban @ 2013-11-15 12:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 15902-ubl+/3LiMTaZdePnXv/OxA

Eli Zaretskii wrote:
>> From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
>> 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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")
  2013-11-15 12:19     ` Sebastien Vauban
@ 2013-11-15 14:05       ` Stefan Monnier
       [not found]         ` <jwvhabd4vev.fsf-monnier+emacsbugs-mXXj517/zsQ@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2013-11-15 14:05 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: 15902

> 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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")
       [not found]         ` <jwvhabd4vev.fsf-monnier+emacsbugs-mXXj517/zsQ@public.gmane.org>
@ 2013-11-15 14:26           ` Sebastien Vauban
  2013-11-16  1:18             ` Stefan Monnier
       [not found]             ` <mailman.6307.1384564761.10748.bug-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Sebastien Vauban @ 2013-11-15 14:26 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 15902-ubl+/3LiMTaZdePnXv/OxA

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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")
  2013-11-15 14:26           ` Sebastien Vauban
@ 2013-11-16  1:18             ` Stefan Monnier
       [not found]             ` <mailman.6307.1384564761.10748.bug-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2013-11-16  1:18 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: 15902

> 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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")
  2013-11-15 11:23 bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save") Sebastien Vauban
  2013-11-15 11:50 ` Eli Zaretskii
@ 2013-11-16 20:15 ` Nicolas Richard
       [not found] ` <mailman.6383.1384633039.10748.bug-gnu-emacs@gnu.org>
  2019-08-18 17:45 ` bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save") Stefan Kangas
  3 siblings, 0 replies; 10+ messages in thread
From: Nicolas Richard @ 2013-11-16 20:15 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-15902-ubl+/3LiMTaZdePnXv/OxA



"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@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.






^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#15902: 24.3.50; ?Auto-save file not deleted when quitting Emacs (and saying "don't?save")
       [not found] ` <mailman.6383.1384633039.10748.bug-gnu-emacs@gnu.org>
@ 2013-11-17 15:17   ` Alan Mackenzie
  0 siblings, 0 replies; 10+ messages in thread
From: Alan Mackenzie @ 2013-11-17 15:17 UTC (permalink / raw)
  To: gnu-emacs-bug


Hi, Nicolas.

Nicolas Richard <theonewiththeevillook@yahoo.fr> wrote:


> "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@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).






^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")
       [not found]             ` <mailman.6307.1384564761.10748.bug-gnu-emacs@gnu.org>
@ 2013-11-27 10:27               ` Francesco Pizzolante
  0 siblings, 0 replies; 10+ messages in thread
From: Francesco Pizzolante @ 2013-11-27 10:27 UTC (permalink / raw)
  To: bug-gnu-emacs

Hi,

I share Sebastien's point of view as I get myself in this situation quite
often.

When quitting Emacs and answering "yes" to the question "Modified buffers
exists; exit anyway?", you *decide* to drop your unsaved modifications, don't
you?

Later on, maybe several months later, when you open this file, it tells you
that "you should consider recovering it" and, in such a case, you do it because
you are worried to lose important changes. But, doing so, you end up with the
changes you didn't want to save in the first place!

In this case, you'll need to lose time making a diff and consider *again* to
drop the changes.

When you use the kill-buffer command on a modified buffer and answering yes to
the question, you decide to drop your changes and the autosave file is dropped
too.

Why this behavior should be different when quitting Emacs?

Thanks for you help.

Best regards,
 Francesco



^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")
  2013-11-15 11:23 bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save") Sebastien Vauban
                   ` (2 preceding siblings ...)
       [not found] ` <mailman.6383.1384633039.10748.bug-gnu-emacs@gnu.org>
@ 2019-08-18 17:45 ` Stefan Kangas
  3 siblings, 0 replies; 10+ messages in thread
From: Stefan Kangas @ 2019-08-18 17:45 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Sebastien Vauban, 15902

tags 15902 + wontfix
close 15902
quit

Stefan Monnier <monnier@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





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-08-18 17:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-15 11:23 bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save") Sebastien Vauban
2013-11-15 11:50 ` Eli Zaretskii
     [not found]   ` <83eh6hj34j.fsf-mXXj517/zsQ@public.gmane.org>
2013-11-15 12:19     ` Sebastien Vauban
2013-11-15 14:05       ` Stefan Monnier
     [not found]         ` <jwvhabd4vev.fsf-monnier+emacsbugs-mXXj517/zsQ@public.gmane.org>
2013-11-15 14:26           ` Sebastien Vauban
2013-11-16  1:18             ` Stefan Monnier
     [not found]             ` <mailman.6307.1384564761.10748.bug-gnu-emacs@gnu.org>
2013-11-27 10:27               ` Francesco Pizzolante
2013-11-16 20:15 ` Nicolas Richard
     [not found] ` <mailman.6383.1384633039.10748.bug-gnu-emacs@gnu.org>
2013-11-17 15:17   ` bug#15902: 24.3.50; ?Auto-save file not deleted when quitting Emacs (and saying "don't?save") Alan Mackenzie
2019-08-18 17:45 ` bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save") Stefan Kangas

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).