summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1997-11-20 21:47:12 +0000
committerKarl Heuer <kwzh@gnu.org>1997-11-20 21:47:12 +0000
commitc5b608af7ed4d2f8c2b79f54fe8a8ff89a5ba0c3 (patch)
tree7b42b48847d830e6f3da42259a8dc3d7a3549ec7 /lisp/help.el
parenta00c2f67666d629781bb7701fc460d29883b970b (diff)
downloademacs-c5b608af7ed4d2f8c2b79f54fe8a8ff89a5ba0c3.tar.gz
(help-with-tutorial-alist): New variable.
(help-with-tutorial): Use help-with-tutorial-alist to read a language name, and also to find the tutorial file for a language.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el19
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/help.el b/lisp/help.el
index d4a007a2189..a7d0155c89c 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -137,19 +137,30 @@ Commands:
(interactive)
nil)
+(defvar help-with-tutorial-alist
+ '(("German" . "TUTORIAL.de")
+ ("Korean" . "TUTORIAL.kr")
+ ("Japanese" . "TUTORIAL.jp")
+ ("Thai" . "TUTORIAL.th")
+ ("English" . "TUTORIAL"))
+ "Alist mapping language names to their translated Emacs tutorial files.")
+
(defun help-with-tutorial (&optional arg)
"Select the Emacs learn-by-doing tutorial.
If there is a tutorial version written in the language
of the selected language environment, that version is used.
If there's no tutorial in that language, `TUTORIAL' is selected.
-With arg, you are asked to select which language."
+With arg, you are asked to choose which language."
(interactive "P")
(let (lang filename file)
(if arg
- (or (setq lang (read-language-name 'tutorial "Language: "))
- (error "No tutorial file of the specified language"))
+ (or (setq lang
+ (let* ((completion-ignore-case t))
+ (completing-read "Language: " help-with-tutorial-alist
+ nil t)))
+ (error "No tutorial file in language"))
(setq lang current-language-environment))
- (setq filename (or (get-language-info lang 'tutorial)
+ (setq filename (or (cdr (assoc lang help-with-tutorial-alist))
"TUTORIAL"))
(setq file (expand-file-name (concat "~/" filename)))
(delete-other-windows)