At startup, the @file{*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 @code{initial-scratch-message},
-which should be either a string, or @code{nil} (which means to
+which should be either a documentation string, or @code{nil} (which means to
suppress the message).
@findex ielm
@item
If the @file{*scratch*} buffer exists and is empty, it inserts
-@code{initial-scratch-message} into that buffer.
+@code{(substitute-command-keys initial-scratch-message)} into that buffer.
@item
If @code{initial-buffer-choice} is a string, it visits the file (or
@defopt initial-scratch-message
This variable, if non-@code{nil}, should be a string, which is
+treated as documentation to be
inserted into the @file{*scratch*} buffer when Emacs starts up. If it
is @code{nil}, the @file{*scratch*} buffer is empty.
@end defopt
and *Buffer List*. This makes Emacs convenient to use from the
command line when `initial-buffer-choice' is non-nil.
++++
+** The value of ‘initial-scratch-message’ is now treated as a doc string
+and can contain escape sequences for command keys, quotes, and the like.
+
\f
* Changes in Emacs 25.1
(defcustom initial-scratch-message (purecopy "\
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
-;; If you want to create a file, visit that file with C-x C-f,
+;; If you want to create a file, visit that file with \\[find-file],
;; then enter the text in that file's own buffer.
")
- "Initial message displayed in *scratch* buffer at startup.
+ "Initial documentation displayed in *scratch* buffer at startup.
If this is nil, no message will be displayed."
:type '(choice (text :tag "Message")
(const :tag "none" nil))
(get-buffer "*scratch*")
(with-current-buffer "*scratch*"
(when (zerop (buffer-size))
- (insert initial-scratch-message)
+ (insert (substitute-command-keys initial-scratch-message))
(set-buffer-modified-p nil))))
;; Prepend `initial-buffer-choice' to `displayable-buffers'.