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: Thu, 25 Sep 2008 22:52:31 -0600
User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)

Xah Lee wrote:
On Sep 24, 12:35 am, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
Kevin Rodgers wrote:
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.

A new buffer is not a existing buffer, so the switch in the name is
unfit. Also, since the function's purpose is creating a new *scratch*,
you should have that in the name to reflect the fact.

In Emacs, you can create a buffer without making it the current buffer
and/or without displaying it.  Emacs uses the verb "switch" to mean
"display the buffer and select the window in which it is displayed".

So, given your code, one step of improvement is to change the name to
new-scratch-buffer or create-scratch-buffer.

Fair enough: switch-to-new-scratch-buffer.

But, as i detailed, since scratch is simply a new buffer, and since
now you can create multiple scratches, it ceases to be one special
buffer emacs called *scratch*.

The *scratch* buffer _is_ special: If you kill it, it is regenerated,
and its major mode is determined by initial-major-mode.  No other buffer
respects that variable.

In contrast, the major mode of the new *scratch*<N> buffers is
determined by default-major-mode.

So, this comes back to my original
suggestion, that it might simply be better to just have create-new-
buffer. And, if you agree this far, then since you now have a
mechanism to create new buffers proper, and the few emacs developers
agree that *scratch* has problems albeit minor one, we might simply at
this point get rid of the *scratch* because create-new-buffer
completely covers its functionality.

I do not agree that it would be better to eliminate the *scratch* buffer
in deference to a create-new-buffer command.  I do not know which Emacs
developers think *scratch* has problems, or what those alleged problems
are.

You can pry the *scratch* buffer from my cold, dead fingers.  :-)

This is exactly what is proposed in my article, alone with code.
See
http://xahlee.org/emacs/modernization_scratch_buffer.html

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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