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: Kevin Rodgers
Subject: Re: How to get rid of *GNU Emacs* buffer on start-up?
Date: Wed, 24 Sep 2008 01:35:51 -0600
User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)

Kevin Rodgers wrote:
Xah Lee wrote:
In summary: the problem with find-file is that it promps user to enter
a file name upfront. The problem with switch-to-buffer is that it
doesn't promp to save when user closes it. In both, the functions are
simply not designed for creating a new temp buffer.

Wow, if you had put 1% of the effort into coding that you put into this
thread, you could have come up with something like this:

(defun switch-to-new-buffer ()
  "Switch to a new *scratch* buffer."
  (interactive)
  (switch-to-buffer (generate-new-buffer "*scratch*"))
  (setq switch-to-new-buffer t))
          ^^^^^^^^^^^^^^^^^^^^

Nikolaj Schumacher's recent message prompted me to check that little
hack, and I see that it's got a typo.  It should be:

(defun switch-to-new-buffer ()
  "Switch to a new *scratch* buffer."
  (interactive)
  (switch-to-buffer (generate-new-buffer "*scratch*"))
  (setq buffer-offer-save t))

You might like (auto-save-mode 1) in there as well.

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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