|
From: | Lennart Borgman (gmail) |
Subject: | Re: make emacs ask to save modified non-file buffers |
Date: | Mon, 23 Jun 2008 08:26:21 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 |
Xah wrote:
(info "(elisp) Killing Buffers")I was already reading that page but it doesn't seems to suggest a solution.
What about the hooks there?
Namely, how to make kill-buffer ask user to save, for buffers that's not associated with file. looking at Aquamacs's source... looks like the “solved” it by actually define its own kill-buffer wrapper, e.g. close-current-window- asktosave. Xah ∑ http://xahlee.org/ ☄ On Jun 22, 5:48 pm, "Lennart Borgman (gmail)" <lennart.borg...@gmail.com> wrote:Xah wrote:when i create a new buffer, how can i make emacs ask to save if it is modified? for example, i have this function: (defun new-empty-buffer () "Opens a new empty buffer." (interactive) (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 modified. 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.
[Prev in Thread] | Current Thread | [Next in Thread] |