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: Emacs: Problems of the Scratch Buffer Date: Wed, 18 Apr 2012 05:00:20 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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 1334750721 31253 80.91.229.3 (18 Apr 2012 12:05:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 18 Apr 2012 12:05:21 +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 Apr 18 14:05:15 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 1SKTdJ-0008MC-FK for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Apr 2012 14:05:13 +0200 Original-Received: from localhost ([::1]:36131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKTdI-0006p0-Mt for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Apr 2012 08:05:12 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!iu9g2000pbc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 79 Original-NNTP-Posting-Host: 76.126.112.84 Original-X-Trace: posting.google.com 1334750420 28249 127.0.0.1 (18 Apr 2012 12:00:20 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 18 Apr 2012 12:00:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: iu9g2000pbc.googlegroups.com; posting-host=76.126.112.84; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:192078 comp.emacs:102405 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:84494 Archived-At: 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 By Xah Lee, 2008-09, =E2=80=A6, 2012-04-18 Here are reasons that the scratch buffer is not useful to most people: 1.It is not useful for 99% of emacs users. If people wanted a scratch pad, they can open a new document and not save it. This way is familiar to all software users. 2.The =E2=80=9C*scratch*=E2=80=9D =E2=80=9Cbuffer=E2=80=9D is designed for= emacs lisp programers. (it defaults to lisp-interaction-mode.) 99% of emacs users are not lisp coders. 3.The =E2=80=9C*scratch*=E2=80=9D =E2=80=9Cbuffer=E2=80=9D is a INTRUSIVE = 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: 1.There is no easy, intuitive way to create multiple scratch buffers. (it is done by calling switch-to-buffer =E3=80=90Ctrl+x b=E3=80=91 then giv= e a name that is not one of existing buffers.) 2.When the scratch buffer is closed, emacs does not prompt user to save it. This easily causes data loss. 3.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 blog article Effective Emacs=E2=86=97, considers creating new temp buffer as a top 10 ti= p in emacs productivity.) 4.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 wr= apper 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 with= menu =E3=80=96File=E2=96=B8New=E3=80=97. Once called, it should create a empty b= uffer titled {untitled, untitled<2>, untitled<3>, =E2=80=A6}. 1.Users can now create multiple temp buffers easily, by just calling =E2=80=9Cnew-buffer=E2=80=9D. No more work-around using =E2=80=9Cswitch-to-= buffer=E2=80=9D method. 2.Data lose is prevented because closing any unsaved buffer will prompt for save. 3.For lisp coders, new buffer can default to a lisp mode. Other programers can default it to python mode, ruby mode, etc. 1.No more redundant and mysterious =E2=80=9C*scratch*=E2=80=9D concept. 2.The menu command =E2=80=9CNew=E2=80=9D is a widely adopted standard amon= g apps across Mac, Windows, Linux. 3.A =E2=80=9Cnew-buffer=E2=80=9D command completely cover the functionalit= y of emacs's =E2=80=9C*scratch*=E2=80=9D buffer. 4.The name =E2=80=9Cuntitled=E2=80=9D is conventional, widely understood. 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.