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

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

Re: How to get rid of *GNU Emacs* buffer on start-up?


From: Xah Lee
Subject: Re: How to get rid of *GNU Emacs* buffer on start-up?
Date: Wed, 24 Sep 2008 04:42:38 -0700 (PDT)
User-agent: G2/1.0

i wrote:
> PS thanks for the (setq buffer-offer-save t) in your code. It is a
> solution to my kludge in my create-new-buffer code about forcing emacs
> to offer save.

oops, my mistake.

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.

The solution i made, is to create a close-current-buffer which offers
to save.

The snipped of code is here:

   ;; offer to save buffers that are non-empty and modified, even for
non-file visiting buffer. (because kill-buffer does not offer to save
buffers that are not associated with files)
   (when (and (buffer-modified-p)
              (not isEmacsBufferBefore)
              (not (string-equal mode-name "Dired by name"))
              (not (string-equal mode-name "Dired by date"))
              (not (string-equal "" (save-restriction (widen) (buffer-
string)))))
     (if (y-or-n-p
            (concat "Buffer " (buffer-name) " modified; Do you want to
save?"))
       (save-buffer)
       (set-buffer-modified-p nil)))


The complete code, again, is here:
http://xahlee.org/emacs/ergonomic_keybinding_dvorak.el
http://xahlee.org/emacs/ergonomic_keybinding_qwerty.el

  Xah
∑ http://xahlee.org/

reply via email to

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