[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 3d08d06: Treat initial-scratch-message as a doc str
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 3d08d06: Treat initial-scratch-message as a doc string |
Date: |
Wed, 02 Sep 2015 22:08:40 +0000 |
branch: master
commit 3d08d06a661344c0ff645e6362e2a2fe1f2e7348
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
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.
---
doc/emacs/building.texi | 2 +-
doc/lispref/os.texi | 3 ++-
etc/NEWS | 4 ++++
lisp/startup.el | 6 +++---
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index b4a99a1..1d40a2d 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 64ebb45..bbe87ca 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
address@hidden into that buffer.
address@hidden(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 address@hidden, 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 c2828c9..3e50943 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 c152e01..e024959 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'.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 3d08d06: Treat initial-scratch-message as a doc string,
Paul Eggert <=