[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make emacs ask to save modified non-file buffers
From: |
Juanma Barranquero |
Subject: |
Re: make emacs ask to save modified non-file buffers |
Date: |
Mon, 23 Jun 2008 10:48:40 +0200 |
On Mon, Jun 23, 2008 at 02:23, Xah <xahlee@gmail.com> wrote:
> according to the manual, the var buffer-offer-save will do it only if
> the buffer is a visiting buffer.
Uh? describe-variable's output for `buffer-offer-save':
[...]
Non-nil in a buffer means always offer to save buffer on exit.
Do so even if the buffer is not visiting a file. <--- ???????
[...]
and the Emacs Lisp Reference's entry for `buffer-offer-save':
-- Variable: buffer-offer-save
This variable, if non-`nil' in a particular buffer, tells
`save-buffers-kill-emacs' and `save-some-buffers' (if the second
optional argument to that function is `t') to offer to save that
buffer, just as they offer to save file-visiting buffers. <--- ???????
The problem here is that `buffer-offer-save' affects the two functions
mentioned above (`save-buffers-kill-emacs' and `save-some-buffers'),
not `kill-buffer'. As Lennart says, you'll have to use
`kill-emacs-hook' or `kill-emacs-query-functions' and add a function
to ask the user and save if appropriate.
Juanma