diff options
| author | Paul Eggert | 2015-09-02 15:08:03 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-09-02 15:08:36 -0700 |
| commit | 3d08d06a661344c0ff645e6362e2a2fe1f2e7348 (patch) | |
| tree | 854030021c8ce65cd6f1a62d57d0c4db2e224703 | |
| parent | b28ad0e9f74646b1126af096a41af20d3e01ad68 (diff) | |
| download | emacs-3d08d06a661344c0ff645e6362e2a2fe1f2e7348.tar.gz emacs-3d08d06a661344c0ff645e6362e2a2fe1f2e7348.zip | |
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.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 3 | ||||
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/startup.el | 6 |
4 files changed, 10 insertions, 5 deletions
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index b4a99a1c25e..1d40a2dd12d 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi | |||
| @@ -1549,7 +1549,7 @@ mode are the same as in Emacs Lisp mode. | |||
| 1549 | At startup, the @file{*scratch*} buffer contains a short message, in | 1549 | At startup, the @file{*scratch*} buffer contains a short message, in |
| 1550 | the form of a Lisp comment, that explains what it is for. This | 1550 | the form of a Lisp comment, that explains what it is for. This |
| 1551 | message is controlled by the variable @code{initial-scratch-message}, | 1551 | message is controlled by the variable @code{initial-scratch-message}, |
| 1552 | which should be either a string, or @code{nil} (which means to | 1552 | which should be either a documentation string, or @code{nil} (which means to |
| 1553 | suppress the message). | 1553 | suppress the message). |
| 1554 | 1554 | ||
| 1555 | @findex ielm | 1555 | @findex ielm |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 64ebb45f23b..bbe87ca6181 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. | |||
| 195 | 195 | ||
| 196 | @item | 196 | @item |
| 197 | If the @file{*scratch*} buffer exists and is empty, it inserts | 197 | If the @file{*scratch*} buffer exists and is empty, it inserts |
| 198 | @code{initial-scratch-message} into that buffer. | 198 | @code{(substitute-command-keys initial-scratch-message)} into that buffer. |
| 199 | 199 | ||
| 200 | @item | 200 | @item |
| 201 | If @code{initial-buffer-choice} is a string, it visits the file (or | 201 | 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. | |||
| 314 | 314 | ||
| 315 | @defopt initial-scratch-message | 315 | @defopt initial-scratch-message |
| 316 | This variable, if non-@code{nil}, should be a string, which is | 316 | This variable, if non-@code{nil}, should be a string, which is |
| 317 | treated as documentation to be | ||
| 317 | inserted into the @file{*scratch*} buffer when Emacs starts up. If it | 318 | inserted into the @file{*scratch*} buffer when Emacs starts up. If it |
| 318 | is @code{nil}, the @file{*scratch*} buffer is empty. | 319 | is @code{nil}, the @file{*scratch*} buffer is empty. |
| 319 | @end defopt | 320 | @end defopt |
| @@ -91,6 +91,10 @@ so if you want to use it, you can always take a copy from an older Emacs. | |||
| 91 | and *Buffer List*. This makes Emacs convenient to use from the | 91 | and *Buffer List*. This makes Emacs convenient to use from the |
| 92 | command line when `initial-buffer-choice' is non-nil. | 92 | command line when `initial-buffer-choice' is non-nil. |
| 93 | 93 | ||
| 94 | +++ | ||
| 95 | ** The value of ‘initial-scratch-message’ is now treated as a doc string | ||
| 96 | and can contain escape sequences for command keys, quotes, and the like. | ||
| 97 | |||
| 94 | 98 | ||
| 95 | * Changes in Emacs 25.1 | 99 | * Changes in Emacs 25.1 |
| 96 | 100 | ||
diff --git a/lisp/startup.el b/lisp/startup.el index c152e0122ae..e0249593893 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -1390,11 +1390,11 @@ settings will be marked as \"CHANGED outside of Customize\"." | |||
| 1390 | 1390 | ||
| 1391 | (defcustom initial-scratch-message (purecopy "\ | 1391 | (defcustom initial-scratch-message (purecopy "\ |
| 1392 | ;; This buffer is for notes you don't want to save, and for Lisp evaluation. | 1392 | ;; This buffer is for notes you don't want to save, and for Lisp evaluation. |
| 1393 | ;; If you want to create a file, visit that file with C-x C-f, | 1393 | ;; If you want to create a file, visit that file with \\[find-file], |
| 1394 | ;; then enter the text in that file's own buffer. | 1394 | ;; then enter the text in that file's own buffer. |
| 1395 | 1395 | ||
| 1396 | ") | 1396 | ") |
| 1397 | "Initial message displayed in *scratch* buffer at startup. | 1397 | "Initial documentation displayed in *scratch* buffer at startup. |
| 1398 | If this is nil, no message will be displayed." | 1398 | If this is nil, no message will be displayed." |
| 1399 | :type '(choice (text :tag "Message") | 1399 | :type '(choice (text :tag "Message") |
| 1400 | (const :tag "none" nil)) | 1400 | (const :tag "none" nil)) |
| @@ -2430,7 +2430,7 @@ nil default-directory" name) | |||
| 2430 | (get-buffer "*scratch*") | 2430 | (get-buffer "*scratch*") |
| 2431 | (with-current-buffer "*scratch*" | 2431 | (with-current-buffer "*scratch*" |
| 2432 | (when (zerop (buffer-size)) | 2432 | (when (zerop (buffer-size)) |
| 2433 | (insert initial-scratch-message) | 2433 | (insert (substitute-command-keys initial-scratch-message)) |
| 2434 | (set-buffer-modified-p nil)))) | 2434 | (set-buffer-modified-p nil)))) |
| 2435 | 2435 | ||
| 2436 | ;; Prepend `initial-buffer-choice' to `displayable-buffers'. | 2436 | ;; Prepend `initial-buffer-choice' to `displayable-buffers'. |