GNU bug report logs - #14512
buffer-offer-save does not affect kill-buffer

Previous Next

Package: emacs;

Reported by: E Sabof <esabof <at> gmail.com>

Date: Thu, 30 May 2013 13:21:01 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 14512 in the body.
You can then email your comments to 14512 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#14512; Package emacs. (Thu, 30 May 2013 13:21:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to E Sabof <esabof <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 30 May 2013 13:21:01 GMT) Full text and rfc822 format available.

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

From: E Sabof <esabof <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24,3; buffer-offer-save doesn't seem to have any effect
Date: Thu, 30 May 2013 14:18:20 +0100
[Message part 1 (text/plain, inline)]
Steps to reproduce:
- emacs -Q
- C-x b test RET
- M-: (setq buffer-offer-save t)
- write some text
- C-x k RET

The buffer is gone, but no prompt is shown.

Evgeni
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14512; Package emacs. (Thu, 30 May 2013 14:07:02 GMT) Full text and rfc822 format available.

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

From: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#14512: 24,3; buffer-offer-save doesn't seem to have any effect
Date: Thu, 30 May 2013 08:05:04 -0600
On 5/30/13 7:18 AM, E Sabof wrote:
> Steps to reproduce:
> - emacs -Q
> - C-x b test RET
> - M-: (setq buffer-offer-save t)
> - write some text
> - C-x k RET
>
> The buffer is gone, but no prompt is shown.

As documented: buffer-offer-save is consulted "on exit" i.e. by
`save-buffers-kill-emacs' and `save-some-buffers'.

The Elisp manual should be updated to also mention `save-buffers-kill-terminal',
since most users exit Emacs via `C-x C-c'.

-- 
Kevin Rodgers
Denver, Colorado, USA





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14512; Package emacs. (Thu, 30 May 2013 14:45:02 GMT) Full text and rfc822 format available.

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

From: E Sabof <esabof <at> gmail.com>
To: kevin.d.rodgers <at> gmail.com, 14512 <at> debbugs.gnu.org
Subject: bug#14512: 24,3; buffer-offer-save doesn't seem to have any effect
Date: Thu, 30 May 2013 15:43:00 +0100
[Message part 1 (text/plain, inline)]
> As documented: buffer-offer-save is consulted "on exit" i.e. by
> `save-buffers-kill-emacs' and `save-some-buffers'.

> The Elisp manual should be updated to also mention
`save-buffers-kill-terminal',
> since most users exit Emacs via `C-x C-c'.

In that case, might it be better to extend the behavior to kill-buffer? I
see little benefit in this third type of behavior. Plus there is no easy
way to protect a buffer from accidental killing.

Evgeni
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14512; Package emacs. (Thu, 30 May 2013 18:12:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: E Sabof <esabof <at> gmail.com>
Cc: kevin.d.rodgers <at> gmail.com, 14512 <at> debbugs.gnu.org
Subject: Re: bug#14512: 24,3; buffer-offer-save doesn't seem to have any effect
Date: Thu, 30 May 2013 20:10:14 +0200
E Sabof <esabof <at> gmail.com> writes:

> Plus there is no easy way to protect a buffer from accidental
> killing.

There is a built-in package for exactly that: emacs-lock.el.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14512; Package emacs. (Thu, 30 May 2013 18:44:02 GMT) Full text and rfc822 format available.

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

From: E Sabof <esabof <at> gmail.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>, 14512 <at> debbugs.gnu.org
Subject: Re: bug#14512: 24,3; buffer-offer-save doesn't seem to have any effect
Date: Thu, 30 May 2013 19:41:51 +0100
[Message part 1 (text/plain, inline)]
It's not exactly the same. There is no connection between locked and saved
states.

Evgeni


On Thu, May 30, 2013 at 7:10 PM, Michael Heerdegen <michael_heerdegen <at> web.de
> wrote:

> E Sabof <esabof <at> gmail.com> writes:
>
> > Plus there is no easy way to protect a buffer from accidental
> > killing.
>
> There is a built-in package for exactly that: emacs-lock.el.
>
> Michael.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14512; Package emacs. (Thu, 30 May 2013 23:12:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: E Sabof <esabof <at> gmail.com>
Cc: 14512 <at> debbugs.gnu.org
Subject: Re: bug#14512: 24,3; buffer-offer-save doesn't seem to have any effect
Date: Thu, 30 May 2013 19:09:57 -0400
If you want Emacs to 

1) offer to save a buffer on exit
2) offer to save a buffer on C-x k

then why not simply make that buffer visit a file?

Because you also probably want

3) some kind of auto-save in case your computer dies while you are
editing the buffer




Changed bug title to 'buffer-offer-save does not affect kill-buffer' from '24,3; buffer-offer-save doesn't seem to have any effect' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 30 May 2013 23:13:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14512; Package emacs. (Thu, 30 May 2013 23:15:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: E Sabof <esabof <at> gmail.com>
Cc: 14512 <at> debbugs.gnu.org
Subject: Re: bug#14512: 24,3; buffer-offer-save doesn't seem to have any effect
Date: Thu, 30 May 2013 19:12:35 -0400
Though having said that, personally I advise kill-buffer to prompt for
confirmation if buffer-offer-save is non-nil.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14512; Package emacs. (Fri, 31 May 2013 00:20:01 GMT) Full text and rfc822 format available.

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

From: E Sabof <esabof <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 14512 <at> debbugs.gnu.org
Subject: Re: bug#14512: 24,3; buffer-offer-save doesn't seem to have any effect
Date: Fri, 31 May 2013 01:17:27 +0100
[Message part 1 (text/plain, inline)]
I no longer use it much, since I create/kill temporary buffers quite often.
But this is the default behavior in most programs, and I suspect many
people would want to change it. My 1 year ago self included.

On second thought, there might be a case for prompting for save only on
emacs exit, but I think it would be more natural if there was a separate
switch to do that, and it was responsible for all

(and (buffer-modified-p)
     (or (buffer-file-name)
         buffer-offer-save))

buffers.

On a related note, I get the impression that the prompt being hard coded is
a remnant from times when kill-buffer-query-functions didn't exist.

Evgeni



On Fri, May 31, 2013 at 12:09 AM, Glenn Morris <rgm <at> gnu.org> wrote:

>
> If you want Emacs to
>
> 1) offer to save a buffer on exit
> 2) offer to save a buffer on C-x k
>
> then why not simply make that buffer visit a file?
>
> Because you also probably want
>
> 3) some kind of auto-save in case your computer dies while you are
> editing the buffer
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14512; Package emacs. (Sat, 05 Feb 2022 23:42:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: E Sabof <esabof <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 14512 <at> debbugs.gnu.org
Subject: Re: bug#14512: buffer-offer-save does not affect kill-buffer
Date: Sun, 06 Feb 2022 00:41:44 +0100
E Sabof <esabof <at> gmail.com> writes:

> > On Fri, May 31, 2013 at 12:09 AM, Glenn Morris <rgm <at> gnu.org> wrote:
> > 
> >  If you want Emacs to
> > 
> >  1) offer to save a buffer on exit
> >  2) offer to save a buffer on C-x k
> > 
> >  then why not simply make that buffer visit a file?

> I no longer use it much, since I create/kill temporary buffers quite
> often. But this is the default behavior in most programs, and I
> suspect many people would want to change it. My 1 year ago self
> included.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

In other programs, all "buffers" are tied to files, so Emacs behaves
quite like them in this regard.

In any case, I think everything here is working as designed, so I'm
therefore closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 14512 <at> debbugs.gnu.org and E Sabof <esabof <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 05 Feb 2022 23:43:01 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. (Sun, 06 Mar 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 165 days ago.

Previous Next


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