From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: mar@centrum.cz (Martin) Newsgroups: gmane.emacs.help Subject: Re: Emacs: Problems of the Scratch Buffer Date: Fri, 20 Apr 2012 13:31:33 +0200 Message-ID: <20120420113133.GD5197@chocholous.lan> 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 1334921531 11725 80.91.229.3 (20 Apr 2012 11:32:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Apr 2012 11:32:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 20 13:32:10 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 1SLC4N-0007Oq-BS for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Apr 2012 13:32:07 +0200 Original-Received: from localhost ([::1]:56344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLC4M-0005tE-Je for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Apr 2012 07:32:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLC4C-0005ss-1q for help-gnu-emacs@gnu.org; Fri, 20 Apr 2012 07:32:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLC42-0006uX-VX for help-gnu-emacs@gnu.org; Fri, 20 Apr 2012 07:31:55 -0400 Original-Received: from justlogin.cz ([77.95.40.248]:57622 helo=netopejr.justlogin.cz) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLC42-0006sx-L3 for help-gnu-emacs@gnu.org; Fri, 20 Apr 2012 07:31:46 -0400 Original-Received: by netopejr.justlogin.cz (Postfix, from userid 115) id 8FB912FC1E4; Fri, 20 Apr 2012 13:31:34 +0200 (CEST) Original-Received: from chocholous.lan (unknown [80.92.248.28]) by netopejr.justlogin.cz (Postfix) with ESMTPA id AF4C22FC0B8 for ; Fri, 20 Apr 2012 13:31:33 +0200 (CEST) Original-Received: by chocholous.lan (Postfix, from userid 1000) id 8E5F5240197; Fri, 20 Apr 2012 13:31:33 +0200 (CEST) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 77.95.40.248 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:84529 Archived-At: just a little script I have written for myself: - - - - (setq create-selection-buffer-counter 0) (defun create-selection-buffer() "Creates a buffer that contains primary X selection." (interactive) (setq create-selection-buffer-counter (+ create-selection-buffer-coun= ter 1)) (setq sel-buf-name (concat "selection-buffer-" (int-to-string create-selection-buffe= r-counter))) (set-buffer (get-buffer-create sel-buf-name)) (yank) (set-window-buffer nil (get-buffer-create sel-buf-name))) - - - - Simple function that automatically creates a new named buffer with whatev= er you have in clipboard m. On Wed, Apr 18, 2012 at 05:00:20AM -0700, 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 > 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 INTRUS= IVE 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= give 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 1= 0 tip > 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 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 = with menu > =E3=80=96File=E2=96=B8New=E3=80=97. Once called, it should create a emp= ty buffer 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 = among apps > across Mac, Windows, Linux. > 3.A =E2=80=9Cnew-buffer=E2=80=9D command completely cover the function= ality of > emacs's =E2=80=9C*scratch*=E2=80=9D buffer. > 4.The name =E2=80=9Cuntitled=E2=80=9D is conventional, widely understo= od. > > 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. >