From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.devel Subject: *scratch* buffer documentation Date: Wed, 25 Dec 2019 08:58:45 +0900 Message-ID: <69AD1F67-BA40-4342-996E-CAC6CC545E2A@traduction-libre.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="211052"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 25 00:59:50 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iju5e-000sjd-KE for ged-emacs-devel@m.gmane.org; Wed, 25 Dec 2019 00:59:50 +0100 Original-Received: from localhost ([::1]:42706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iju5c-0003Mk-SY for ged-emacs-devel@m.gmane.org; Tue, 24 Dec 2019 18:59:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33607) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iju5W-0003Mc-DV for emacs-devel@gnu.org; Tue, 24 Dec 2019 18:59:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iju5S-0001ZE-7y for emacs-devel@gnu.org; Tue, 24 Dec 2019 18:59:41 -0500 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:48793) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iju5R-0001Yr-VP for emacs-devel@gnu.org; Tue, 24 Dec 2019 18:59:38 -0500 Original-Received: from [10.251.103.131] (unknown [210.160.37.46]) (Authenticated sender: jean.christophe.helary@traduction-libre.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 9B8A6240002 for ; Tue, 24 Dec 2019 23:59:22 +0000 (UTC) X-Mailer: Apple Mail (2.3608.40.2.2.4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.70.178.230 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243617 Archived-At: I am not seeing anything in the Emacs manual that says a modified = *scratch* buffer does not trigger a "buffer modified. Kill anyway ?" = message when quitting. The first reference to the *scratch* buffer is in "5 Entering Emacs" and = it implicitly refers to the "Lisp Interaction" section to know more. = After checking other instances of *scratch* in the manual, it seems that = the "Lisp Interaction" section is the place where most of the = information about the *scratch* buffer is gathered. It reads: ------- When Emacs starts up, it contains a buffer named =E2=80=98*scratch*=E2=80=99= , which is provided for evaluating Emacs Lisp expressions interactively. Its major mode is Lisp Interaction mode. You can also enable Lisp Interaction mode by typing =E2=80=98M-x lisp-interaction-mode=E2=80=99. In the =E2=80=98*scratch*=E2=80=99 buffer, and other Lisp Interaction = mode buffers, =E2=80=98C-j=E2=80=99 (=E2=80=98eval-print-last-sexp=E2=80=99) evaluates = the Lisp expression before point, and inserts the value at point. Thus, as you type expressions into the buffer followed by =E2=80=98C-j=E2=80=99 after each expression, = the buffer records a transcript of the evaluated expressions and their values. All other commands in Lisp Interaction mode are the same as in Emacs Lisp mode. At startup, the =E2=80=98*scratch*=E2=80=99 buffer contains a short = message, in the form of a Lisp comment, that explains what it is for. This message is controlled by the variable =E2=80=98initial-scratch-message=E2=80=99, = which should be either a documentation string, or =E2=80=98nil=E2=80=99 (which means to = suppress the message). An alternative way of evaluating Emacs Lisp expressions interactively is to use Inferior Emacs Lisp mode, which provides an interface rather like Shell mode (*note Shell Mode::) for evaluating Emacs Lisp expressions. Type =E2=80=98M-x ielm=E2=80=99 to create an =E2=80=98*ielm*= =E2=80=99 buffer which uses this mode. For more information, see that command=E2=80=99s = documentation. ------- I'd like to propose to modify it this way: ------- The *scratch* buffer When Emacs starts up, it contains a buffer named =E2=80=98*scratch*=E2=80=99= , which is provided for evaluating Emacs Lisp expressions interactively. Its major mode is Lisp Interaction mode. At startup, the =E2=80=98*scratch*=E2=80=99 buffer contains a short = message, in the form of a Lisp comment, that explains what it is for. This message is controlled by the variable =E2=80=98initial-scratch-message=E2=80=99, = which should be either a documentation string, or =E2=80=98nil=E2=80=99 (which means to = suppress the message). If you kill the =E2=80=98*scratch*=E2=80=99 buffer after a = modification, Emacs will not ask you to confirm the kill and the = contents of the =E2=80=98*scratch*=E2=80=99 buffer will be lost. This = behavior is not customizable. Lisp Interaction mode You can enable Lisp Interaction mode in other buffers by typing = =E2=80=98M-x lisp-interaction-mode=E2=80=99. In Lisp Interaction mode buffers, including the =E2=80=98*scratch*=E2=80= =99 buffer, =E2=80=98C-j=E2=80=99 (=E2=80=98eval-print-last-sexp=E2=80=99) evaluates = the Lisp expression before point, and inserts the value at point. Thus, as you type expressions into the buffer followed by =E2=80=98C-j=E2=80=99 after each expression, = the buffer records a transcript of the evaluated expressions and their values. All other commands in Lisp Interaction mode are the same as in Emacs Lisp mode. An alternative way of evaluating Emacs Lisp expressions interactively is to use Inferior Emacs Lisp mode, which provides an interface rather like Shell mode (*note Shell Mode::) for evaluating Emacs Lisp expressions. Type =E2=80=98M-x ielm=E2=80=99 to create an =E2=80=98*ielm*= =E2=80=99 buffer which uses this mode. For more information, see that command=E2=80=99s = documentation. ------- Jean-Christophe Helary ----------------------------------------------- http://mac4translators.blogspot.com @brandelune