From unknown Fri Aug 15 18:04:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#1109 <1109@debbugs.gnu.org> To: bug#1109 <1109@debbugs.gnu.org> Subject: Status: Suggestions on emacs's scratch buffer Reply-To: bug#1109 <1109@debbugs.gnu.org> Date: Sat, 16 Aug 2025 01:04:34 +0000 retitle 1109 Suggestions on emacs's scratch buffer reassign 1109 emacs submitter 1109 xah lee severity 1109 wishlist thanks From xah@xahlee.org Tue Oct 7 07:32:35 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.8 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 7 Oct 2008 14:32:35 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m97EWV3x017547 for ; Tue, 7 Oct 2008 07:32:32 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnDby-0006na-NV for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 10:32:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnDbv-0006ml-83 for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 10:32:29 -0400 Received: from [199.232.76.173] (port=57849 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnDbv-0006mi-3t for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 10:32:27 -0400 Received: from mout.perfora.net ([74.208.4.195]:60826) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KnDbu-0005qf-OT for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 10:32:26 -0400 Received: from [192.168.1.2] (c-24-6-185-159.hsd1.ca.comcast.net [24.6.185.159]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1KnDbi2Vpg-0005FX; Tue, 07 Oct 2008 10:32:16 -0400 Mime-Version: 1.0 (Apple Message framework v753.1) Content-Transfer-Encoding: quoted-printable Message-Id: Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed To: bug-gnu-emacs@gnu.org From: xah lee Subject: Suggestions on emacs's scratch buffer Date: Tue, 7 Oct 2008 07:31:27 -0700 X-Mailer: Apple Mail (2.753.1) X-Provags-ID: V01U2FsdGVkX1+jEoTCwBcCqfAvuzmDEOfGU3zflv7apgZjVkw IAtAxowt99Z0yLiOmF0otXYV4H7OcvFFZxwpCQ3MSWgCFPo/2y dumiymY89yTFkMIrJY5kg== X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6? (barebone, rare!) Hi emacs developers, Here's a suggestion on emacs scratch buffer i thought might be =20 interesting. Last month there's a maybe 200 messages flamefeast in gnu.emacs.help =20 on this issue. I am not sure this suggestion about removing *scratch* buffer is =20 sensible to most emacs developers, but i thought i'd put it in bug =20 database for what's its worth. The full article of my reasons and suggestions is at: http://xahlee.org/emacs/modernization_scratch_buffer.html plain text version follows below my sig. Thanks for your consideration. Best, Xah =E2=88=91 http://xahlee.org/ =E2=98=84 --------------------------------------------- Suggestions on Emacs's Scratch Buffer Xah Lee, 2008-09 In the article The Modernization of Emacs, i suggested that emacs's =20 =E2=80=9C*scratch*=E2=80=9D buffer be removed. In this article, i give = some detail =20 about it. In the article, i gave the following as primary reasons that scratch =20 buffer should be removed: =E2=80=A2 It is not useful by 99% of letter writers. If they wanted = a =20 scratch pad, they can open a new document and not save it. This way =20 is familiar to all software users. =E2=80=A2 The =E2=80=9C*scratch*=E2=80=9D =E2=80=9Cbuffer=E2=80=9D = is primarily designed for =20 elisp programers. (it defaults to lisp mode) Majority of people who =20 use emacs are not lisp coders. For lisp coders, they can easily =20 customize their emacs to have a =E2=80=9C*scratch*=E2=80=9D = =E2=80=9Cbuffer=E2=80=9D. =E2=80=A2 The =E2=80=9C*scratch*=E2=80=9D =E2=80=9Cbuffer=E2=80=9D = is a intrusive idiosyncrasy. =20 It is persistent, cannot be closed (it regenerates). It is foreign to =20= all programers. This idiosyncrasy is the first thing presented to =20 users, and it persists. Here are few minor reasons: =E2=80=A2 There is no easy, intuitive way to create multiple = scratch =20 buffers. (it is done by using the switch-to-buffer command (C-x b) =20 and give name that is not one of existing buffers.) =E2=80=A2 When the scratch buffer is closed, emacs does not prompt = user =20 to save it. This easily causes data loss. =E2=80=A2 A scratch pad can be very useful not just for temporary = elisp =20 code but for any scratch notes or programing in other languages. (For =20= example, well known programer Stevey Yegg in his popular Effective =20 Emacs=E2=86=97 blog list it as a top 10 tip in emacs productivity.) =20 Emacs's =E2=80=9C*scratch*=E2=80=9D buffer is narrowly geared for elisp = editing =20 only, defaulting to emacs-lisp-mode. =E2=80=A2 Emacs does not provide a user level function to create a = new =20 buffer. It has menu =E2=80=9CFile=E2=80=A3Open file...=E2=80=9D (a = wrapper to the find-=20 file command), which immediately prompt user for a full file path. =20 This is annoying. Modern apps's New File command actually just create =20= a new untitled file without prompting, and only when user save it it =20 prompt a file name. If user closes it, it prompts for saving. Proposed Fix I propose that emacs should also add a menu command =E2=80=9CNew = buffer=E2=80=9D, =20 with the keyboard shortcut =E2=80=9CCtrl+n=E2=80=9D. Once called, it = should create =20 a scratch buffer titled =E2=80=9Cuntitled=E2=80=9D. If one already = exists, append =20 numbers such =E2=80=9Cuntitled 2=E2=80=9D. Here are the reasons: =E2=80=A2 The menu command =E2=80=9CNew=E2=80=9D is a widely = adopted standard among =20 apps across Mac, Windows, unixes. It is familiar to all software users. =E2=80=A2 The Ctrl+n shortcut for New is standard and familiar to = all =20 software users. =E2=80=A2 A New Buffer command (where the corresponding elisp = command =20 name might be named new-empty-buffer), can completely cover the =20 functionality of emacs's =E2=80=9C*scratch*=E2=80=9D buffer. =E2=80=A2 When users want to have a scratch buffer, he can create = it by =20 simply pressing the shortcut, and when he doesn't want it, he can =20 simply close it with a standard keystroke Ctrl+w. =E2=80=A2 By adopting the New Buffer and Ctrl+n, users can = intuitively =20 create multiple scratch buffers for any purpose. =E2=80=A2 The name =E2=80=9Cuntitled=E2=80=9D is conventional, far = more widely =20 understood, and more general than =E2=80=9Cscratch=E2=80=9D. =E2=80=A2 For those who use scratch buffer for elisp coding, she = can =20 set a preference (e.g. emacs customize feature) so that the new =20 buffer default to emacs-lisp-mode. =E2=80=A2 Adopting the suggestion would fix several problems for = those =20 who actually use emacs's =E2=80=9C*scratch*=E2=80=9D buffer. (1) emacs = no longer =20 mysteriously spawn a =E2=80=9C*scratch*=E2=80=9D when emacs starts, or = respawn =20 the =E2=80=9C*scratch*=E2=80=9D buffer when user tries to close all = buffers. (2) =20 Multiple scratch buffers can be created by a keyboard shortcut. (3) =20 Data lose is prevented because closing a scratch buffer will prompt =20 for save. Note: the proposed keybinding =E2=80=9CCtrl+n=E2=80=9D and =E2=80=9CCtrl+w= =E2=80=9D need not =20 be part of this proposal because emacs already use =E2=80=9CCtrl+n=E2=80=9D= and =20 =E2=80=9CCtrl+w=E2=80=9D for basic cursor movement and cut. However, it = could be =20 adapted in conjunction with newly designed Ergonomic Keybinding. (see =20= below) Draft Implementation The above suggestion is experimentally implemented in my Ergonomic =20 Keyboard Shortcut Layout For Emacs. The following are the elisp files. =E2=80=A2 ergonomic_keybinding_dvorak.el. =E2=80=A2 ergonomic_keybinding_qwerty.el. Some detail about the implementation: =E2=80=A2 create-new-buffer will create a new empty buffer named =20= =E2=80=9Cuntitled=E2=80=9D. (this should be added to the menu under = =E2=80=9CFile=E2=80=A3New =20 Buffer=E2=80=9D but i haven't done that yet.) =E2=80=A2 create-new-buffer has standard keyboard shortcut Ctrl+n. =E2=80=A2 elisp command close-current-buffer will close the current = =20 buffer, and if it is a buffer not associated with a file (such as =20 =E2=80=9Cuntitled=E2=80=9D), it'll ask user to save (unless it has no = content) =E2=80=A2 close-current-buffer has the standard keyboard shortcut = Ctrl+w. =E2=80=A2 close-current-buffer should have menu under =20 =E2=80=9CFile=E2=80=A3Close=E2=80=9D, but it is not currently done. The = existing =20 =E2=80=9CFile=E2=80=A3Close=E2=80=9D menu command in emacs 22.2 calls = kill-this-buffer, =20 which has 2 problems. (1) it doesn't have a shortcut. (2) it doesn't =20 ask users to save a buffer that are not associated with file (in =20 effect, any text in the buffer is irreversibly lost immediately). The =20= standard emacs command used to close a file is kill-buffer (Ctrl+x =20 k). It has a major problem of prompting user even if the file is =20 already saved. I have been using the above code daily since late 2007, with =20 incremental improvement and bug fixes. i'm sure it can use a lot more =20= polishing for public use. The code is GPL'd, so feel free to grab =20 pieces for your own use or submit into GNU. =E2=98=84 From cyd@stupidchicken.com Tue Oct 7 09:56:52 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.9 required=4.0 tests=AWL,BAYES_00, VALID_BTS_CONTROL autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at control) by emacsbugs.donarmstrong.com; 7 Oct 2008 16:56:52 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m97GundN021105 for ; Tue, 7 Oct 2008 09:56:51 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 6324C57E0BF; Tue, 7 Oct 2008 12:58:26 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: reassign bugs Date: Tue, 07 Oct 2008 12:58:26 -0400 Message-ID: <87zllgtk99.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii severity 1109 wishlist severity 1110 wishlist severity 1111 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Thu May 10 15:09:39 2012 Received: (at control) by debbugs.gnu.org; 10 May 2012 19:09:39 +0000 Received: from localhost ([127.0.0.1]:47121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SSYk7-0004rZ-5X for submit@debbugs.gnu.org; Thu, 10 May 2012 15:09:39 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:36035 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SSYk5-0004rS-0r for control@debbugs.gnu.org; Thu, 10 May 2012 15:09:37 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SSYk3-0004KB-O2 for control@debbugs.gnu.org; Thu, 10 May 2012 15:09:35 -0400 Date: Thu, 10 May 2012 15:09:35 -0400 Message-Id: Subject: control message for bug 11298 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) merge 1109 11298 From unknown Fri Aug 15 18:04:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 13 Dec 2013 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator