From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Corneli Newsgroups: gmane.emacs.help Subject: Re: Emacs: Problems of the Scratch Buffer Date: Wed, 18 Apr 2012 13:31:48 +0100 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 1334765948 31071 80.91.229.3 (18 Apr 2012 16:19:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 18 Apr 2012 16:19:08 +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 18:19:03 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 1SKXav-0003Su-Ja for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Apr 2012 18:19:01 +0200 Original-Received: from localhost ([::1]:49675 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKXau-0001Eq-Vp for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Apr 2012 12:19:00 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKU3B-0004kK-T4 for help-gnu-emacs@gnu.org; Wed, 18 Apr 2012 08:32:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKU35-0007Ig-Al for help-gnu-emacs@gnu.org; Wed, 18 Apr 2012 08:31:57 -0400 Original-Received: from mail-ob0-f169.google.com ([209.85.214.169]:60429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKU35-0007IO-3S for help-gnu-emacs@gnu.org; Wed, 18 Apr 2012 08:31:51 -0400 Original-Received: by obbeh20 with SMTP id eh20so5409859obb.0 for ; Wed, 18 Apr 2012 05:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Y97IdI/CcW2kXAszRxNrf2SPsd3Vby6nkAyaYqdfjtw=; b=Vzsh5HZ6bMh7kiBctTeLewu/6uolvJ93CXiP2ISzfFjAGrwBXazsO0OM67xUaflXcd 2Z3SpQA1dtZIR8Vrbo8LvlNtz3iA/UQaUBHBg6YMAzdTh6NySfyY4nuA1qSdh7LyTzPq iKzwFolyLpYL4RHi8BwTXZFt6qg0IlmSYaUxMCnNpZKjGpC7/akZQClmgKLQ0rxOn3BV 8Pdus/qiJCqx1A150EChyAvPNIFxsjh6IYQHEoLuWuMa9lpusVmjW+crNkLRwuzQBlAJ LgtB3nFT7ZHTvs0u1fxwO+zYmUfgAMh3xWLjt4+99HH6OeZkhMu04LOQIxqn6bUEM5FF Inbw== Original-Received: by 10.182.77.167 with SMTP id t7mr2809541obw.10.1334752308359; Wed, 18 Apr 2012 05:31:48 -0700 (PDT) Original-Received: by 10.182.231.2 with HTTP; Wed, 18 Apr 2012 05:31:48 -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-Mailman-Approved-At: Wed, 18 Apr 2012 12:18:56 -0400 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:84495 Archived-At: A long time ago I wrote something called scrat.el that somewhat improves scratch buffer functioning - what do you think? http://lists.gnu.org/archive/html/gnu-emacs-sources/2004-06/msg00035.html On Wed, Apr 18, 2012 at 1:00 PM, 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. > =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.) > =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. > > =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.