[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make emacs ask to save modified non-file buffers

From: Lennart Borgman (gmail)
Subject: Re: make emacs ask to save modified non-file buffers
Date: Mon, 23 Jun 2008 02:48:29 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071031 Thunderbird/ Mnenhy/

Xah wrote:
when i create a new buffer, how can i make emacs ask to save if it is

for example, i have this function:

(defun new-empty-buffer ()
  "Opens a new empty buffer."
  (let ((buf (generate-new-buffer "untitled")))
    (switch-to-buffer buf)
    (funcall (and initial-major-mode))
    (setq buffer-offer-save t)

after calling, it'll create a new buffer. Then, if user edit the
buffer, then close it (using either kill-buffer or kill-this-buffer),
then i want emacs to ask whether to save it if the buffer has been

according to the manual, the var buffer-offer-save will do it only if
the buffer is a visiting buffer. Then the manual talks about save-some-
buffers second argument but i don't see how this fits together, since
i don't actually want to call save-some-buffers.

(info "(elisp) Killing Buffers")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]