[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...
- Re: How to get rid of *GNU Emacs* buffer on start-up?, (continued)
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Kevin Rodgers, 2008/09/19
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Kevin Rodgers, 2008/09/24
- Message not available
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Xah Lee, 2008/09/24
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Kevin Rodgers, 2008/09/26
- Message not available
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Xah, 2008/09/26
- Message not available
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Xah Lee, 2008/09/19
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Kevin Rodgers, 2008/09/24
- Message not available
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Xah Lee, 2008/09/24
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Xah Lee, 2008/09/24
- Re: How to get rid of *GNU Emacs* buffer on start-up?, rustom, 2008/09/24
- Bug? buffer-offer-save,
Xah Lee <=
- Re: Bug? buffer-offer-save, Juanma Barranquero, 2008/09/24
- Re: Bug? buffer-offer-save, Juanma Barranquero, 2008/09/24
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Kevin Rodgers, 2008/09/26
- Message not available
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Xah, 2008/09/26
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Alan Mackenzie, 2008/09/26
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Kevin Rodgers, 2008/09/26
- Message not available
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Chetan, 2008/09/26
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Andreas Politz, 2008/09/27
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Xah, 2008/09/27
- Message not available
- Re: How to get rid of *GNU Emacs* buffer on start-up?, Xah, 2008/09/27