]> code.delx.au - gnu-emacs/commitdiff
Treat initial-scratch-message as a doc string
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Sep 2015 22:08:03 +0000 (15:08 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Sep 2015 22:08:36 +0000 (15:08 -0700)
* 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.

doc/emacs/building.texi
doc/lispref/os.texi
etc/NEWS
lisp/startup.el

index b4a99a1c25ede074415950407855a40fa3343bb0..1d40a2dd12d0c47dc7dd1afc0458738ecd19835a 100644 (file)
@@ -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
index 64ebb45f23b8fbec39227024763a4e89997f8ee2..bbe87ca6181975baae06f0a14502598cca601c13 100644 (file)
@@ -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
index c2828c9db517a1270da543733b7f101a2582dfd2..3e50943c3361ed52adbec57d4d6ffac38290c44d 100644 (file)
--- 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.
+
 \f
 * Changes in Emacs 25.1
 
index c152e0122ae595c4ebda2d2faa80a39caf8b7641..e0249593893793eb79f79eda750ebe0ac4b0ed75 100644 (file)
@@ -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'.