summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1997-02-20 05:45:01 +0000
committerKarl Heuer <kwzh@gnu.org>1997-02-20 05:45:01 +0000
commitda40a12351fc2dcf28599032df4f61f071c0c4dc (patch)
treee81ed54e5524c0527b70673032fed7004a163339 /lisp
parent586e892f7f02c98ce781f4c7a58d6ece65d06d0c (diff)
downloademacs-da40a12351fc2dcf28599032df4f61f071c0c4dc.tar.gz
(help-with-tutorial): Prefix argument to specify a
language interactively.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/help.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 9f4c2cf352b..3e65659fee8 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -129,10 +129,17 @@ Commands:
(interactive)
nil)
-(defun help-with-tutorial ()
- "Select the Emacs learn-by-doing tutorial."
- (interactive)
- (let ((file (expand-file-name "~/TUTORIAL")))
+(defun help-with-tutorial (&optional arg)
+ "Select the Emacs learn-by-doing tutorial.
+A tutorial written in the current primary language is selected.
+If there's no tutorial in the language, \"TUTORIAL\" is selected.
+With arg, users are asked to select language."
+ (interactive "P")
+ (let* ((filename
+ (let ((lang (if arg (read-language-name 'tutorial "Language: ")
+ primary-language)))
+ (get-language-info lang 'tutorial)))
+ (file (expand-file-name (concat "~/" filename))))
(delete-other-windows)
(if (get-file-buffer file)
(switch-to-buffer (get-file-buffer file))
@@ -140,7 +147,7 @@ Commands:
(setq buffer-file-name file)
(setq default-directory (expand-file-name "~/"))
(setq buffer-auto-save-file-name nil)
- (insert-file-contents (expand-file-name "TUTORIAL" data-directory))
+ (insert-file-contents (expand-file-name filename data-directory))
(goto-char (point-min))
(search-forward "\n<<")
(beginning-of-line)