help-gnu-emacs
[Top][All Lists]
Advanced

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

Bug? buffer-offer-save


From: Xah Lee
Subject: Bug? buffer-offer-save
Date: Wed, 24 Sep 2008 06:33:56 -0700 (PDT)
User-agent: G2/1.0

To test this which seems like a bug to me, do this:

eval this code:

(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)))

then call it. You'll have a new buffer. Now type something in it. Now,
go to the menu “File‣Close”.

You'll see that emacs closes the buffer immediately without offering
save.

  Xah
∑ http://xahlee.org/

☄


On Sep 24, 5:51 am, rustom <rustompm...@gmail.com> wrote:
> On Sep 24, 4:42 pm, Xah Lee <x...@xahlee.org> wrote:
>
> > I actually have the line
> > (setq buffer-offer-save t)
> > in my code for new-empty-buffer, but emacs still closes the buffer
> > without saving, seemingly contrary to its doc.
>
> Do you have it on a hook? Like so?
>
> (add-hook 'lisp-interaction-mode-hook (function (lambda () (setq
> buffer-offer-save t))))
>
> The above works for me -- asking to save the scratch buffer *if
> changed*
> Only problem is that fundamental-mode does not AFAIK have a hook.
> Wonder why...



reply via email to

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