all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Juanma Barranquero" <lekktu@gmail.com>
To: Xah <xahlee@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: make emacs ask to save modified non-file buffers
Date: Mon, 23 Jun 2008 10:48:40 +0200	[thread overview]
Message-ID: <f7ccd24b0806230148s25d39264nc56cdfbf7bb7764b@mail.gmail.com> (raw)
In-Reply-To: <635b5b5f-398f-44a0-8bf2-873a050696bb@v1g2000pra.googlegroups.com>

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




      parent reply	other threads:[~2008-06-23  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23  0:23 make emacs ask to save modified non-file buffers Xah
2008-06-23  0:48 ` Lennart Borgman (gmail)
     [not found] ` <mailman.13718.1214182118.18990.help-gnu-emacs@gnu.org>
2008-06-23  4:02   ` Xah
2008-06-23  6:26     ` Lennart Borgman (gmail)
2008-06-23  8:48 ` Juanma Barranquero [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7ccd24b0806230148s25d39264nc56cdfbf7bb7764b@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=xahlee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.