Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 154985 - emacs should always warn before losing data
Summary: emacs should always warn before losing data
Alias: None
Product: Fedora
Classification: Fedora
Component: emacs
Version: 3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jens Petersen
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-04-15 12:18 UTC by John Smith
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Last Closed: 2005-10-03 08:48:40 UTC

Attachments (Terms of Use)

Description John Smith 2005-04-15 12:18:42 UTC
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 08:48:40 UTC
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.