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 03:02:30 -0700 (PDT) Organization: http://groups.google.com Message-ID: <095ef0c0-c7f4-494d-8bf6-8a5ee43fd934@i20g2000prf.googlegroups.com> References: <873ajzwoqu.fsf@kobe.laptop> <823901dd-c54c-4e3b-b6ad-512d52724a46@z11g2000prl.googlegroups.com> <87ljxoffs6.fsf@atthis.clsnet.nl> <71208e97-140c-445d-8eda-1705f11b14b3@r15g2000prd.googlegroups.com> 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 1222253175 25266 80.91.229.12 (24 Sep 2008 10:46:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Sep 2008 10:46:15 +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 12:47:12 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 1KiRtc-0002Xw-H7 for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Sep 2008 12:47:01 +0200 Original-Received: from localhost ([127.0.0.1]:35537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiRsZ-0001lv-10 for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Sep 2008 06:45:55 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!goblin1!goblin2!goblin.stu.neva.ru!feeder.erje.net!proxad.net!feeder1-2.proxad.net!64.233.178.134.MISMATCH!postnews.google.com!i20g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 155 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1222250550 24356 127.0.0.1 (24 Sep 2008 10:02:30 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 24 Sep 2008 10:02:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i20g2000prf.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:162650 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:57992 Archived-At: On Sep 24, 12:54 am, Kevin Rodgers > Here's my attempt at critical thinking: > > 1. You said that find-file and switch-to-buffer each have problems, so I > wrote a new command that has neither problem. That is called a > solution. Yes. > 2. You said that neither function is designed for creating a new > temporary buffer. That is true of find-file, which can create a new > buffer, but a buffer whose contents are to be persisted i.e. not > temporary. I think switch-to-buffer _is_ designed for creating a new > temporary buffer, just a buffer that has a user-specified name. this i don't agree. Quote from my article: =C2=AB * There is no easy, intuitive way to create multiple scratch buffers. (it is done by using the switch-to-buffer command (C-x b) and give name that is not one of existing buffers.) * When the scratch buffer is closed, emacs does not prompt user to save it. This easily causes data loss. * A scratch pad can be very useful not just for temporary elisp code but for any scratch notes or programing in other languages. (For example, well known programer Stevey Yegg in his popular Effective Emacs=E2=86=97 blog list it as a top 10 tip in emacs productivity.) Emacs's =E2=80=9C*scratch*=E2=80=9D buffer is narrowly geared for elisp editing onl= y, defaulting to emacs-lisp-mode. * Emacs does not provide a user level function to create a new buffer. It has menu =E2=80=9CFile=E2=80=A3Open file...=E2=80=9D (a wrapper = to the find-file command), which immediately prompt user for a full file path. This is annoying. Modern apps's New File command actually just create a new untitled file without prompting, and only when user save it it prompt a file name. If user closes it, it prompts for saving. =C2=BB More specifically, in different wording now: the problem with switch- to-buffer for creating new buffer is that it is simply not designed for it. It is only a side effect. (similar to, say, the unix =E2=80=9Ctouch= =E2=80=9D command is used to create new file, and unix =E2=80=9Cmv=E2=80=9D command i= s used for renaming, and in unix the boulean operators for =E2=80=9Cand=E2=80=9D (&&) = and =E2=80=9Cor=E2=80=9D (||) are used for program flow... and quite a lot such= quirks in various langs.) Sure, it you can use a hammer as a weapon and various things but not the right design for something is a problem. More specifically: =E2=80=A2 switch-to-buffer the name does not convey it's use as a create-ne= w- buffer. =E2=80=A2 By using it for the purpose of creating new buffer and as well as switching buffer, it has multiple purposes. Thes 2 purpsose are semantically distinct and in practice doesn't mix. =E2=80=A2 when user uses switch-to-buffer for creating new buffer, it again= , just like find-file, promp user to type a name. Also, user needs to give a name not one of existing buffers. The problem with trivial prompting is well know is UI, especiall its problems can be seen in Microsoft Windows OS, where every minute it prompts users for this or that which is quite annoying. A better way, to let user decided to name something when user needs to. > 3. You contradict yourself to some degree by complaining that > temporary buffers can be killed without prompting the user about > whether and under what name to save them. I think it would be clearer > if you said "empty" buffer instead of "temporary". I'm not sure i understood exactly what u mean. What i meant in my article or post was that, emacs won't offer save for buffers not associated with a file. This is so for buffers created using the switch-to-buffer command. > I prefer progress to modernization. The =E2=80=9Cmodernization=E2=80=9D is just a descriptive tag. Am not sure = exactly what you mean. Modernization is simply a collective term for emacs improvements that happens to make emacs more compatible with modern terminologies, UI sandards. Many tech geekers will perhaps think =E2=80=9Cmodernization=E2=80=9D means =E2=80=9Clet's make emacs like Micros= oft=E2=80=9D. No. It is not the intention nor the goal. (Of interest to note, that it is EXACTLY Linux's KDE's prominently published manifesto, for example, when it starts in about 1998.) For example, if i think modernization of emacs means making it behave like Microsoft apps, then i would have suggest using popup dialogs and get rid of scratch buffer, using XML instead of elisp for user prefs, using standard menu instead of the emacs's ones, get rid of dired, use standard Microsoft help app and format instead of C-h and info, possibly incorporate pop langs such as VisualBasic and replace elisp. The modernization i proposed, is intended to make emacs more efficient, powerful, and get rid of its primary criticism of usability problem. I believe, my propose solve the problem well, is quite conservative, is simple to implement, having no major change to emacs ways and consistency. ( Please give it a thought: http://xahlee.org/emacs/m= odernization.html ) --------------------------------------------------- Your solution based on switch-to-buffer: > (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 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. Xah =E2=88=91 http://xahlee.org/ =E2=98=84