aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/startup.el
diff options
context:
space:
mode:
authorThien-Thi Nguyen <[email protected]>2005-04-04 07:41:58 +0000
committerThien-Thi Nguyen <[email protected]>2005-04-04 07:41:58 +0000
commit959f1226db5995807d0bb4a942ec6d24bb813406 (patch)
treef660a7943d4d2874deb67a5c6a313f79f4913838 /lisp/startup.el
parentc9541e2d305fab019ebfc41b19755978f6ad91af (diff)
(fancy-splash-text): Shorten default text of
"Emacs Tutorial" line. Also, if the current language env indicates an available tutorial file other than TUTORIAL, extract its title and append it to the line in parentheses. (fancy-splash-insert): If arg is a thunk, funcall it.
Diffstat (limited to 'lisp/startup.el')
-rw-r--r--lisp/startup.el31
1 files changed, 27 insertions, 4 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index 49a5d88e75..7be4faceb5 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1004,8 +1004,27 @@ If this is nil, no message will be displayed."
using the mouse.\n\n"
:face (variable-pitch :weight bold)
"Important Help menu items:\n"
- :face variable-pitch "\
-Emacs Tutorial\tLearn-by-doing tutorial for using Emacs efficiently
+ :face variable-pitch
+ (lambda ()
+ (let* ((en "TUTORIAL")
+ (tut (or (get-language-info current-language-environment
+ 'tutorial)
+ en))
+ (title (with-temp-buffer
+ (insert-file-contents
+ (expand-file-name tut data-directory)
+ nil 0 256)
+ (search-forward ".")
+ (buffer-substring (point-min) (1- (point))))))
+ ;; If there is a specific tutorial for the current language
+ ;; environment and it is not English, append its title.
+ (concat
+ "Emacs Tutorial\tLearn how to use Emacs efficiently"
+ (if (string= en tut)
+ ""
+ (concat " (" title ")"))
+ "\n")))
+ :face variable-pitch "\
Emacs FAQ\tFrequently asked questions and answers
Read the Emacs Manual\tView the Emacs manual using Info
\(Non)Warranty\tGNU Emacs comes with "
@@ -1069,14 +1088,18 @@ Values less than 60 seconds are ignored."
(defun fancy-splash-insert (&rest args)
"Insert text into the current buffer, with faces.
-Arguments from ARGS should be either strings or pairs `:face FACE',
+Arguments from ARGS should be either strings, functions called
+with no args that return a string, or pairs `:face FACE',
where FACE is a valid face specification, as it can be used with
`put-text-properties'."
(let ((current-face nil))
(while args
(if (eq (car args) :face)
(setq args (cdr args) current-face (car args))
- (insert (propertize (car args)
+ (insert (propertize (let ((it (car args)))
+ (if (functionp it)
+ (funcall it)
+ it))
'face current-face
'help-echo fancy-splash-help-echo)))
(setq args (cdr args)))))