From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: How to get rid of *GNU Emacs* buffer on start-up? Date: Wed, 24 Sep 2008 02:26:30 -0700 (PDT) Organization: http://groups.google.com Message-ID: <31ddf1ec-5b63-4005-9c9e-d0006a44408e@s9g2000prg.googlegroups.com> References: <873ajzwoqu.fsf@kobe.laptop> <823901dd-c54c-4e3b-b6ad-512d52724a46@z11g2000prl.googlegroups.com> <87ljxoffs6.fsf@atthis.clsnet.nl> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1222249374 12574 80.91.229.12 (24 Sep 2008 09:42:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Sep 2008 09:42:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 24 11:43:51 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KiQuK-0005oD-8z for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Sep 2008 11:43:40 +0200 Original-Received: from localhost ([127.0.0.1]:41350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiQtI-0000hd-7o for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Sep 2008 05:42:36 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s9g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 55 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1222248391 17388 127.0.0.1 (24 Sep 2008 09:26:31 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 24 Sep 2008 09:26:31 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s9g2000prg.googlegroups.com; posting-host=24.6.185.159; posting-account=qPxGtQkAAADb6PWdLGiWVucht1ZDR6fn User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:162646 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57990 Archived-At: On Sep 24, 12:35 am, Kevin Rodgers wrote: > Kevin Rodgers wrote: > >XahLeewrote: > >> 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. 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. So, given your code, one step of improvement is to change the name to new-scratch-buffer or create-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*. 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. This is exactly what is proposed in my article, alone with code. See http://xahlee.org/emacs/modernization_scratch_buffer.html Xah =E2=88=91 http://xahlee.org/ =E2=98=84