From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aaron Meurer Newsgroups: gmane.emacs.help Subject: Re: Emacs: Problems of the Scratch Buffer Date: Wed, 18 Apr 2012 13:33:47 -0600 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1334777677 31865 80.91.229.3 (18 Apr 2012 19:34:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 18 Apr 2012 19:34:37 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xah Lee Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 18 21:34:32 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SKae4-0002q3-Ni for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Apr 2012 21:34:28 +0200 Original-Received: from localhost ([::1]:44930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKae4-000564-1x for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Apr 2012 15:34:28 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKadu-000555-Jw for help-gnu-emacs@gnu.org; Wed, 18 Apr 2012 15:34:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKadn-0004aH-3u for help-gnu-emacs@gnu.org; Wed, 18 Apr 2012 15:34:18 -0400 Original-Received: from mail-ob0-f169.google.com ([209.85.214.169]:60189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKadm-0004Zh-RE for help-gnu-emacs@gnu.org; Wed, 18 Apr 2012 15:34:11 -0400 Original-Received: by obbeh20 with SMTP id eh20so5944291obb.0 for ; Wed, 18 Apr 2012 12:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=zYZRwp2Dn3+gIIOXHGSF+omzcve3C3y0h6zAceKhGsc=; b=G5GpwMuADNe2Wio+jCPZCsS1npPCox16w5k37Vlkzg/5C66Ixfx91f85/yzAffKS/s Vro6qGvCOV1fOXQVj+4nz2BjC6tcXXxciXhg+Hz0Uqvx8kIC5aeKs3t33E1ZRsjno0wm zuIviyBi25wOTwtVTIQbXVui2Ov67hOO1TuK3kQugix6SdVzHaEgnnBR0m2XG/oJLZJ9 epj4JXLq0a6zU70lBLjiWFwr1qPlw9+8UQrdvoU5UFFR9CTZ4FkRCJLkAm2aKO3qCDEA KdfiAEY1YO/rlQF5tZreWQGsY8epDJr2t/A4T4d8ky5p0g8qzeWt4bssgcdVRLBe4j0p K4qw== Original-Received: by 10.182.89.39 with SMTP id bl7mr4661663obb.65.1334777647942; Wed, 18 Apr 2012 12:34:07 -0700 (PDT) Original-Received: by 10.182.109.41 with HTTP; Wed, 18 Apr 2012 12:33:47 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84502 Archived-At: On Wed, Apr 18, 2012 at 6:00 AM, Xah Lee wrote: > for entertainment purpose only. > > =E3=80=88Emacs: Problems of the Scratch Buffer=E3=80=89 > http://xahlee.org/emacs/modernization_scratch_buffer.html > > --------------------------------------------- > > Emacs: Problems of the Scratch Buffer > =C2=A0By Xah Lee, 2008-09, =E2=80=A6, 2012-04-18 > > Here are reasons that the scratch buffer is not useful to most people: > > =C2=A01.It is not useful for 99% of emacs users. If people wanted a scrat= ch > pad, they can open a new document and not save it. This way is > familiar to all software users. > =C2=A02.The =E2=80=9C*scratch*=E2=80=9D =E2=80=9Cbuffer=E2=80=9D is desig= ned for emacs lisp programers. (it > defaults to lisp-interaction-mode.) 99% of emacs users are not lisp > coders. > =C2=A03.The =E2=80=9C*scratch*=E2=80=9D =E2=80=9Cbuffer=E2=80=9D is a INT= RUSIVE IDIOSYNCRASY. New users are > not familiar what it is. It is the first thing presented to users, and > it persists. > > Scratch Buffer is Inconvenient > > Here are reasons that a alternative to =E2=80=9C*scratch*=E2=80=9D =E2=80= =9Cbuffer=E2=80=9D is more > useful: > > =C2=A01.There is no easy, intuitive way to create multiple scratch buffer= s. > (it is done by calling switch-to-buffer =E3=80=90Ctrl+x b=E3=80=91 then g= ive a name > that is not one of existing buffers.) > =C2=A02.When the scratch buffer is closed, emacs does not prompt user to > save it. This easily causes data loss. I think this is the whole point. > =C2=A03.A scratch pad can be very useful not just for temporary elisp cod= e > but for any scratch notes or programing in other languages. (For > example, well known programer Stevey Yegg in his popular blog article > Effective Emacs=E2=86=97, considers creating new temp buffer as a top 10 = tip > in emacs productivity.) I agree. The scratch buffer seems to be made so you could easily type and execute lisp code interactively. But even if you just want to run one lisp command, you can type it literally anywhere and type C-x C-e (the disadvantage is you won't get syntax highlighting or completion if you are not in lisp-mode). IMHO, *scratch* should default to text-mode. > =C2=A04.Emacs does not provide a user level function to create a new > buffer. It has menu =E3=80=96File=E2=96=B8Open file=E2=80=A6=E3=80=97 (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 prompt only when user wants to > save it. If user closes it, it prompts for saving. > > Proposed Fix: Adding a =E2=80=9Cnew-buffer=E2=80=9D Command > > I propose that emacs should add a command =E2=80=9Cnew-buffer=E2=80=9D wi= th menu > =E3=80=96File=E2=96=B8New=E3=80=97. Once called, it should create a empty= buffer titled > {untitled, untitled<2>, untitled<3>, =E2=80=A6}. > > =C2=A01.Users can now create multiple temp buffers easily, by just callin= g > =E2=80=9Cnew-buffer=E2=80=9D. No more work-around using =E2=80=9Cswitch-t= o-buffer=E2=80=9D method. > =C2=A02.Data lose is prevented because closing any unsaved buffer will > prompt for save. > =C2=A03.For lisp coders, new buffer can default to a lisp mode. Other > programers can default it to python mode, ruby mode, etc. +1 for this plan. One thing, though. I do like how opening emacs with no files gives you the scratch buffer. I just think it should default to text mode. > > =C2=A01.No more redundant and mysterious =E2=80=9C*scratch*=E2=80=9D conc= ept. > =C2=A02.The menu command =E2=80=9CNew=E2=80=9D is a widely adopted standa= rd among apps > across Mac, Windows, Linux. > =C2=A03.A =E2=80=9Cnew-buffer=E2=80=9D command completely cover the funct= ionality of > emacs's =E2=80=9C*scratch*=E2=80=9D buffer. > =C2=A04.The name =E2=80=9Cuntitled=E2=80=9D is conventional, widely under= stood. > > Implementation > > The above suggestion is implemented in ErgoEmacs Keybinding, where you > simply press =E3=80=90Ctrl+n=E3=80=91 to create a new buffer. Well you'd need a normal keybinding too, assumedly one that's C-x C-something. C-n moves down a line, and I don't think that's going to change any time soon. Aaron Meurer