unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jean-Christophe Helary <jean.christophe.helary@traduction-libre.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: *scratch* buffer documentation
Date: Wed, 25 Dec 2019 08:58:45 +0900	[thread overview]
Message-ID: <69AD1F67-BA40-4342-996E-CAC6CC545E2A@traduction-libre.org> (raw)

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





             reply	other threads:[~2019-12-24 23:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-24 23:58 Jean-Christophe Helary [this message]
2019-12-25  1:24 ` *scratch* buffer documentation Ó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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69AD1F67-BA40-4342-996E-CAC6CC545E2A@traduction-libre.org \
    --to=jean.christophe.helary@traduction-libre.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).