summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-09-02 15:08:03 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-09-02 15:08:36 -0700
commit3d08d06a661344c0ff645e6362e2a2fe1f2e7348 (patch)
tree854030021c8ce65cd6f1a62d57d0c4db2e224703
parentb28ad0e9f74646b1126af096a41af20d3e01ad68 (diff)
Treat initial-scratch-message as a doc string
* doc/emacs/building.texi (Lisp Interaction): * doc/lispref/os.texi (Startup Summary): * etc/NEWS: Document this. * lisp/startup.el (initial-scratch-message): Look up find-file’s key rather than hardcoding it. (command-line-1): Substitute the doc string. This also substitutes the quotes, which will help test display quoting at startup.
-rw-r--r--doc/emacs/building.texi2
-rw-r--r--doc/lispref/os.texi3
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/startup.el6
4 files changed, 10 insertions, 5 deletions
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index b4a99a1c25..1d40a2dd12 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -1549,7 +1549,7 @@ mode are the same as in Emacs Lisp mode.
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
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 64ebb45f23..bbe87ca618 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -195,7 +195,7 @@ It now exits if the option @code{--batch} was specified.
@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
@@ -314,6 +314,7 @@ file will not inhibit the message for someone else.
@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
diff --git a/etc/NEWS b/etc/NEWS
index c2828c9db5..3e50943c33 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -91,6 +91,10 @@ so if you want to use it, you can always take a copy from an older Emacs.
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.
+
* Changes in Emacs 25.1
diff --git a/lisp/startup.el b/lisp/startup.el
index c152e0122a..e024959389 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1390,11 +1390,11 @@ settings will be marked as \"CHANGED outside of Customize\"."
(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))
@@ -2430,7 +2430,7 @@ nil default-directory" name)
(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'.