# HG changeset patch # User Thien-Thi Nguyen # Date 1112600518 0 # Node ID 56619c3aaf998b38408ca273eef5cd41f38e2145 # Parent aadcbac4a52e52f7f0810855082e78f27c1cc1e4 (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. diff -r aadcbac4a52e -r 56619c3aaf99 lisp/startup.el --- a/lisp/startup.el Mon Apr 04 07:35:10 2005 +0000 +++ b/lisp/startup.el Mon Apr 04 07:41:58 2005 +0000 @@ -1004,8 +1004,27 @@ 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 @@ (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)))))