unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* *scratch* buffer documentation
@ 2019-12-24 23:58 Jean-Christophe Helary
  2019-12-25  1:24 ` Óscar Fuentes
  2019-12-25 14:55 ` Eli Zaretskii
  0 siblings, 2 replies; 26+ messages in thread
From: Jean-Christophe Helary @ 2019-12-24 23:58 UTC (permalink / raw)
  To: emacs-devel

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 ‘*scratch*’, 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 ‘M-x lisp-interaction-mode’.

   In the ‘*scratch*’ buffer, and other Lisp Interaction mode buffers,
‘C-j’ (‘eval-print-last-sexp’) evaluates the Lisp expression before
point, and inserts the value at point.  Thus, as you type expressions
into the buffer followed by ‘C-j’ 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 ‘*scratch*’ 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 ‘initial-scratch-message’, which should be
either a documentation string, or ‘nil’ (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 ‘M-x ielm’ to create an ‘*ielm*’ buffer which uses
this mode.  For more information, see that command’s documentation.
-------


I'd like to propose to modify it this way:

-------
The *scratch* buffer

When Emacs starts up, it contains a buffer named ‘*scratch*’, which is
provided for evaluating Emacs Lisp expressions interactively.  Its major
mode is Lisp Interaction mode.

   At startup, the ‘*scratch*’ 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 ‘initial-scratch-message’, which should be
either a documentation string, or ‘nil’ (which means to suppress the
message).

   If you kill the ‘*scratch*’ buffer after a modification, Emacs will not ask you to confirm the kill and the contents of the ‘*scratch*’ buffer will be lost.  This behavior is not customizable.

Lisp Interaction mode

   You can enable Lisp Interaction mode in other buffers by typing ‘M-x lisp-interaction-mode’.

   In Lisp Interaction mode buffers, including the ‘*scratch*’ buffer,
‘C-j’ (‘eval-print-last-sexp’) evaluates the Lisp expression before
point, and inserts the value at point.  Thus, as you type expressions
into the buffer followed by ‘C-j’ 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 ‘M-x ielm’ to create an ‘*ielm*’ buffer which uses
this mode.  For more information, see that command’s documentation.
-------


Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune





^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2019-12-27 18:45 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-24 23:58 *scratch* buffer documentation Jean-Christophe Helary
2019-12-25  1:24 ` Óscar Fuentes
2019-12-25  1:44   ` Jean-Christophe Helary
2019-12-25 14:55 ` Eli Zaretskii
2019-12-26  0:54   ` Jean-Christophe Helary
2019-12-26  2:29     ` arthur miller
2019-12-26  3:00       ` Jean-Christophe Helary
2019-12-26  3:27         ` Óscar Fuentes
2019-12-26  5:19           ` Jean-Christophe Helary
2019-12-26  5:20           ` Jean-Christophe Helary
2019-12-26 16:22     ` Eli Zaretskii
2019-12-26 17:15       ` Jean-Christophe Helary
2019-12-26 17:36         ` Lars Ingebrigtsen
2019-12-26 18:14           ` Jean-Christophe Helary
2019-12-26 20:25         ` Eli Zaretskii
2019-12-27  1:03           ` Jean-Christophe Helary
2019-12-27  8:12             ` Eli Zaretskii
2019-12-27  9:12               ` Jean-Christophe Helary
2019-12-27  9:26                 ` Eli Zaretskii
2019-12-27  9:44                   ` Jean-Christophe Helary
2019-12-27 11:31               ` VanL
2019-12-27 14:06                 ` Eli Zaretskii
2019-12-27 18:24                   ` John Yates
2019-12-27 18:45                     ` Eli Zaretskii
2019-12-27 16:12               ` Drew Adams
2019-12-27 17:07               ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).