aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/international/mule-cmds.el82
1 files changed, 44 insertions, 38 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 86adc522705..5e61717fb03 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -41,7 +41,7 @@
41(define-key mule-keymap "\C-\\" 'select-input-method) 41(define-key mule-keymap "\C-\\" 'select-input-method)
42(define-key mule-keymap "c" 'universal-coding-system-argument) 42(define-key mule-keymap "c" 'universal-coding-system-argument)
43 43
44(define-key help-map "\C-L" 'describe-language-support) 44(define-key help-map "\C-L" 'describe-language-environment)
45(define-key help-map "\C-\\" 'describe-input-method) 45(define-key help-map "\C-\\" 'describe-input-method)
46(define-key help-map "C" 'describe-current-coding-system) 46(define-key help-map "C" 'describe-current-coding-system)
47(define-key help-map "h" 'view-hello-file) 47(define-key help-map "h" 'view-hello-file)
@@ -54,8 +54,8 @@
54 54
55(setq menu-bar-final-items (cons 'mule menu-bar-final-items)) 55(setq menu-bar-final-items (cons 'mule menu-bar-final-items))
56 56
57(defvar describe-language-support-map nil) 57(defvar describe-language-environment-map nil)
58(define-prefix-command 'describe-language-support-map) 58(define-prefix-command 'describe-language-environment-map)
59 59
60(defvar setup-language-environment-map nil) 60(defvar setup-language-environment-map nil)
61(define-prefix-command 'setup-language-environment-map) 61(define-prefix-command 'setup-language-environment-map)
@@ -66,8 +66,8 @@
66(define-key-after mule-menu-keymap [toggle-mule] 66(define-key-after mule-menu-keymap [toggle-mule]
67 '("Toggle MULE facility" . toggle-enable-multibyte-characters) 67 '("Toggle MULE facility" . toggle-enable-multibyte-characters)
68 t) 68 t)
69(define-key-after mule-menu-keymap [describe-language-support] 69(define-key-after mule-menu-keymap [describe-language-environment]
70 '("Describe language support" . describe-language-support-map) 70 '("Describe language environment" . describe-language-environment-map)
71 t) 71 t)
72(define-key-after mule-menu-keymap [set-language-environment] 72(define-key-after mule-menu-keymap [set-language-environment]
73 '("Set language environment" . setup-language-environment-map) 73 '("Set language environment" . setup-language-environment-map)
@@ -193,18 +193,25 @@ KEY is a symbol denoting the kind of information.
193INFO is any Lisp object which contains the actual information. 193INFO is any Lisp object which contains the actual information.
194 194
195Currently, the following KEYs are used by Emacs: 195Currently, the following KEYs are used by Emacs:
196
196charset: list of symbols whose values are charsets specific to the language. 197charset: list of symbols whose values are charsets specific to the language.
198
197coding-system: list of coding systems specific to the langauge. 199coding-system: list of coding systems specific to the langauge.
200
198tutorial: a tutorial file name written in the language. 201tutorial: a tutorial file name written in the language.
202
199sample-text: one line short text containing characters of the language. 203sample-text: one line short text containing characters of the language.
204
200input-method: alist of input method names for the language vs information 205input-method: alist of input method names for the language vs information
201 for activating them. Use `register-input-method' (which see) 206 for activating them. Use `register-input-method' (which see)
202 to add a new input method to the alist. 207 to add a new input method to the alist.
208
203documentation: t or a string describing how Emacs supports the language. 209documentation: t or a string describing how Emacs supports the language.
204 If a string is specified, it is shown before any other information 210 If a string is specified, it is shown before any other information
205 of the language by the command describe-language-support. 211 of the language by the command `describe-language-environment'.
212
206setup-function: a function to call for setting up environment 213setup-function: a function to call for setting up environment
207 convenient for a user of the language. 214 convenient for a user of the language.
208 215
209If KEY is documentation or setup-function, you can also specify 216If KEY is documentation or setup-function, you can also specify
210a cons cell as INFO, in which case, the car part should be 217a cons cell as INFO, in which case, the car part should be
@@ -213,9 +220,8 @@ and the cdr part should be a symbol whose value is a menu keymap
213in which an entry for the language is defined. But, only the car part 220in which an entry for the language is defined. But, only the car part
214is actually set as the information. 221is actually set as the information.
215 222
216Emacs will use more KEYs in the future. To avoid conflict, users 223We will define more KEYs in the future. To avoid conflict,
217should use prefix \"user-\" in the name of KEY if he wants to set 224if you want to use your own KEY values, make them start with `user-'."
218different kind of information for personal use."
219 (let (lang-slot key-slot) 225 (let (lang-slot key-slot)
220 (setq lang-slot (assoc language-name language-info-alist)) 226 (setq lang-slot (assoc language-name language-info-alist))
221 (if (null lang-slot) ; If no slot for the language, add it. 227 (if (null lang-slot) ; If no slot for the language, add it.
@@ -232,7 +238,7 @@ different kind of information for personal use."
232 (if (consp info) 238 (if (consp info)
233 (prog1 (symbol-value (cdr info)) 239 (prog1 (symbol-value (cdr info))
234 (setq info (car info))) 240 (setq info (car info)))
235 describe-language-support-map) 241 describe-language-environment-map)
236 (vector (intern language-name)) 242 (vector (intern language-name))
237 (cons language-name 'describe-specified-language-support) 243 (cons language-name 'describe-specified-language-support)
238 t)) 244 t))
@@ -504,35 +510,41 @@ and sometimes other things."
504;; Print a language specific information such as input methods, 510;; Print a language specific information such as input methods,
505;; charsets, and coding systems. This function is intended to be 511;; charsets, and coding systems. This function is intended to be
506;; called from the menu: 512;; called from the menu:
507;; [menu-bar mule describe-language-support LANGUAGE] 513;; [menu-bar mule describe-language-environment LANGUAGE]
508;; and should not run it by `M-x describe-current-input-method-function'. 514;; and should not run it by `M-x describe-current-input-method-function'.
509(defun describe-specified-language-support () 515(defun describe-specified-language-support ()
510 "Describe how Emacs supports the specified langugage." 516 "Describe how Emacs supports the specified langugage."
511 (interactive) 517 (interactive)
512 (let (language-name doc) 518 (let (language-name)
513 (if (not (and (symbolp last-command-event) 519 (if (not (and (symbolp last-command-event)
514 (setq language-name (symbol-name last-command-event)) 520 (setq language-name (symbol-name last-command-event))))
515 (setq doc (get-language-info language-name 'documentation))))
516 (error "Bogus calling sequence")) 521 (error "Bogus calling sequence"))
522 (describe-language-environment language-name)))
523
524(defun describe-language-environment (language-name)
525 "Describe how Emacs supports language environment LANGUAGE-NAME."
526 (interactive (list (read-language-name 'documentation "Language: ")))
527 (if (or (null language-name)
528 (null (get-language-info language-name 'documentation)))
529 (error "No documentation for the specified language"))
530 (let ((doc (get-language-info language-name 'documentation)))
517 (with-output-to-temp-buffer "*Help*" 531 (with-output-to-temp-buffer "*Help*"
518 (if (stringp doc) 532 (if (stringp doc)
519 (princ-list doc)) 533 (princ-list doc))
520 (princ "-----------------------------------------------------------\n") 534 (terpri)
521 (princ-list "List of items specific to "
522 language-name
523 " support")
524 (princ "-----------------------------------------------------------\n")
525 (let ((str (get-language-info language-name 'sample-text))) 535 (let ((str (get-language-info language-name 'sample-text)))
526 (if (stringp str) 536 (if (stringp str)
527 (progn 537 (progn
528 (princ "<sample text>\n") 538 (princ "Sample text:\n")
529 (princ-list " " str)))) 539 (princ-list " " str))))
530 (princ "<input methods>\n") 540 (terpri)
541 (princ "Input methods:\n")
531 (let ((l (get-language-info language-name 'input-method))) 542 (let ((l (get-language-info language-name 'input-method)))
532 (while l 543 (while l
533 (princ-list " " (car (car l))) 544 (princ-list " " (car (car l)))
534 (setq l (cdr l)))) 545 (setq l (cdr l))))
535 (princ "<character sets>\n") 546 (terpri)
547 (princ "Character sets:\n")
536 (let ((l (get-language-info language-name 'charset))) 548 (let ((l (get-language-info language-name 'charset)))
537 (if (null l) 549 (if (null l)
538 (princ-list " nothing specific to " language-name) 550 (princ-list " nothing specific to " language-name)
@@ -540,23 +552,17 @@ and sometimes other things."
540 (princ-list " " (car l) ": " 552 (princ-list " " (car l) ": "
541 (charset-description (car l))) 553 (charset-description (car l)))
542 (setq l (cdr l))))) 554 (setq l (cdr l)))))
543 (princ "<coding systems>\n") 555 (terpri)
556 (princ "Coding systems:\n")
544 (let ((l (get-language-info language-name 'coding-system))) 557 (let ((l (get-language-info language-name 'coding-system)))
545 (if (null l) 558 (if (null l)
546 (princ-list " nothing specific to " language-name) 559 (princ-list " nothing specific to " language-name)
547 (while l 560 (while l
548 (princ-list " " (car l) ":\n\t" 561 (princ (format " %s (`%c' in mode line):\n\t%s\n"
549 (coding-system-docstring (car l))) 562 (car l)
563 (coding-system-mnemonic (car l))
564 (coding-system-docstring (car l))))
550 (setq l (cdr l)))))))) 565 (setq l (cdr l))))))))
551
552(defun describe-language-support (language-name)
553 "Describe how Emacs supports LANGUAGE-NAME."
554 (interactive (list (read-language-name 'documentation "Language: ")))
555 (if (or (null language-name)
556 (null (get-language-info language-name 'documentation)))
557 (error "No documentation for the specified language"))
558 (let ((last-command-event (intern language-name)))
559 (describe-specified-language-support)))
560 566
561;;; Charset property 567;;; Charset property
562 568