Bug 154985 - emacs should always warn before losing data
emacs should always warn before losing data
Product: Fedora
Classification: Fedora
Component: emacs (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2005-04-15 08:18 EDT by John Smith
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-03 04:48:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Smith 2005-04-15 08:18:42 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.6) Gecko/20050323 Fedora/1.7.6-1.3.2

Description of problem:
When a new buffer is created (with C-x b f o o RET, not with C-x f ...)
but not saved as a file, emacs doesn't warn that its contents will be
lost when the user hits C-x C-c.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Launch emacs.
2. Type C-x b f o o RET b a r C-x C-c
3. Now emacs has closed without warning.

Actual Results:  The contents of the buffer (here, "bar") are lost.

Expected Results:  emacs should ask "modified buffers exist; exit anyway ?".
Or at least there should be a configurable option for this.

Additional info:

"You should use C-x b only to switch to an existing buffer, and C-x f to
create a new buffer" is not an adequate answer.  I often need temporary
buffers, like *scratch*, for data which I certainly do not want to save
to a file, but which I however do not want to lose if I inadvertently
hit C-x C-c.  And even though C-x f will not create the file if the contents
are not saved, it is intended for data which is meant to be saved.  Example:
with a default configuration, if you create a buffer with C-x f, write something
in it, then hit C-x C-c and answer "n" to "Save this buffer ?" and then "yes"
to "Exit anyway ?", you will have an autosave #file# lying around.
Comment 1 Jens Petersen 2005-10-03 04:48:40 EDT
As you quote, this is indeed the intended behaviour by upstream.
If you want to take this up further you suggest requesting the
change to be make upstream on the emacs-devel mailing list.
But Emacs has behaved this way for a very long time, so you
may find it easier to switch your usual usage to using C-x C-f
instead of C-x C-b to create new buffers.  :-)  Or if you really
want to write a small elisp extension to warning you about
buffers, but the intention is that buffer that don't have
an associated file are temporary and don't need to be saved
on closing.

Note You need to log in before you can comment on or make changes to this bug.