diff options
| author | Karl Heuer | 1997-11-20 21:47:12 +0000 |
|---|---|---|
| committer | Karl Heuer | 1997-11-20 21:47:12 +0000 |
| commit | c822b44bedde28187ecc15fd7c771f368709a975 (patch) | |
| tree | 7c485593c61fdb5f00d9a321d9f3950fa27c1763 /lisp | |
| parent | d1782bd882dc768d06d49234c7af86f344bcf653 (diff) | |
| download | emacs-c822b44bedde28187ecc15fd7c771f368709a975.tar.gz emacs-c822b44bedde28187ecc15fd7c771f368709a975.zip | |
(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')
| -rw-r--r-- | lisp/help.el | 19 |
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: | |||
| 137 | (interactive) | 137 | (interactive) |
| 138 | nil) | 138 | nil) |
| 139 | 139 | ||
| 140 | (defvar help-with-tutorial-alist | ||
| 141 | '(("German" . "TUTORIAL.de") | ||
| 142 | ("Korean" . "TUTORIAL.kr") | ||
| 143 | ("Japanese" . "TUTORIAL.jp") | ||
| 144 | ("Thai" . "TUTORIAL.th") | ||
| 145 | ("English" . "TUTORIAL")) | ||
| 146 | "Alist mapping language names to their translated Emacs tutorial files.") | ||
| 147 | |||
| 140 | (defun help-with-tutorial (&optional arg) | 148 | (defun help-with-tutorial (&optional arg) |
| 141 | "Select the Emacs learn-by-doing tutorial. | 149 | "Select the Emacs learn-by-doing tutorial. |
| 142 | If there is a tutorial version written in the language | 150 | If there is a tutorial version written in the language |
| 143 | of the selected language environment, that version is used. | 151 | of the selected language environment, that version is used. |
| 144 | If there's no tutorial in that language, `TUTORIAL' is selected. | 152 | If there's no tutorial in that language, `TUTORIAL' is selected. |
| 145 | With arg, you are asked to select which language." | 153 | With arg, you are asked to choose which language." |
| 146 | (interactive "P") | 154 | (interactive "P") |
| 147 | (let (lang filename file) | 155 | (let (lang filename file) |
| 148 | (if arg | 156 | (if arg |
| 149 | (or (setq lang (read-language-name 'tutorial "Language: ")) | 157 | (or (setq lang |
| 150 | (error "No tutorial file of the specified language")) | 158 | (let* ((completion-ignore-case t)) |
| 159 | (completing-read "Language: " help-with-tutorial-alist | ||
| 160 | nil t))) | ||
| 161 | (error "No tutorial file in language")) | ||
| 151 | (setq lang current-language-environment)) | 162 | (setq lang current-language-environment)) |
| 152 | (setq filename (or (get-language-info lang 'tutorial) | 163 | (setq filename (or (cdr (assoc lang help-with-tutorial-alist)) |
| 153 | "TUTORIAL")) | 164 | "TUTORIAL")) |
| 154 | (setq file (expand-file-name (concat "~/" filename))) | 165 | (setq file (expand-file-name (concat "~/" filename))) |
| 155 | (delete-other-windows) | 166 | (delete-other-windows) |