Mercurial > emacs
comparison lisp/international/mule-cmds.el @ 17840:2517414676ed
(set-language-info): Change the special treatment
of key describe-function to documentation.
(describe-specified-language-support): Renamed from
describe-language-support-internal. Get language name from
last-command-event.
(describe-language-support): Call
describe-specified-language-support.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 16 May 1997 00:59:07 +0000 |
parents | 8c67c2e2cc29 |
children | 65407fdc4a33 |
comparison
equal
deleted
inserted
replaced
17839:b4a81f70d905 | 17840:2517414676ed |
---|---|
161 tutorial: a tutorial file name written in the language. | 161 tutorial: a tutorial file name written in the language. |
162 sample-text: one line short text containing characters of the language. | 162 sample-text: one line short text containing characters of the language. |
163 input-method: alist of input method names for the language vs information | 163 input-method: alist of input method names for the language vs information |
164 for activating them. Use `register-input-method' (which see) | 164 for activating them. Use `register-input-method' (which see) |
165 to add a new input method to the alist. | 165 to add a new input method to the alist. |
166 documentation: a string describing how Emacs supports the langauge. | 166 documentation: a string describing how Emacs supports the language, |
167 describe-function: a function to call for descriebing how Emacs supports | 167 or a list of a string, or t. In the latter two cases, |
168 the language. The function uses information listed abobe. | 168 the other detailed information is also shown by the command |
169 describe-language-support. | |
169 setup-function: a function to call for setting up environment | 170 setup-function: a function to call for setting up environment |
170 convenient for the language. | 171 convenient for the language. |
171 | 172 |
172 Emacs will use more KEYs in the future. To avoid conflict, users | 173 Emacs will use more KEYs in the future. To avoid conflict, users |
173 should use prefix \"user-\" in the name of KEY if he wants to set | 174 should use prefix \"user-\" in the name of KEY if he wants to set |
182 (progn | 183 (progn |
183 (setq key-slot (list key)) | 184 (setq key-slot (list key)) |
184 (setcdr lang-slot (cons key-slot (cdr lang-slot))))) | 185 (setcdr lang-slot (cons key-slot (cdr lang-slot))))) |
185 (setcdr key-slot info) | 186 (setcdr key-slot info) |
186 ;; Setup menu. | 187 ;; Setup menu. |
187 (cond ((eq key 'describe-function) | 188 (cond ((eq key 'documentation) |
188 (define-key-after mule-describe-language-support-map | 189 (define-key-after mule-describe-language-support-map |
189 (vector (intern language-name)) | 190 (vector (intern language-name)) |
190 (cons language-name info) | 191 (cons language-name 'describe-specified-language-support) |
191 t)) | 192 t)) |
192 ((eq key 'setup-function) | 193 ((eq key 'setup-function) |
193 (define-key-after mule-set-language-environment-map | 194 (define-key-after mule-set-language-environment-map |
194 (vector (intern language-name)) | 195 (vector (intern language-name)) |
195 (cons language-name info) | 196 (cons language-name info) |
417 ;; Print all arguments with `princ', then print "\n". | 418 ;; Print all arguments with `princ', then print "\n". |
418 (defsubst princ-list (&rest args) | 419 (defsubst princ-list (&rest args) |
419 (while args (princ (car args)) (setq args (cdr args))) | 420 (while args (princ (car args)) (setq args (cdr args))) |
420 (princ "\n")) | 421 (princ "\n")) |
421 | 422 |
423 ;; Print a language specific information such as input methods, | |
424 ;; charsets, and coding systems. This function is intended to be | |
425 ;; called from the menu: | |
426 ;; [menu-bar mule describe-language-support LANGUAGE] | |
427 ;; and should not run it by `M-x describe-current-input-method-function'. | |
428 (defun describe-specified-language-support () | |
429 "Describe how Emacs supports the specified langugage." | |
430 (interactive) | |
431 (let (language-name doc) | |
432 (if (not (and (symbolp last-command-event) | |
433 (setq language-name (symbol-name last-command-event)) | |
434 (setq doc (get-language-info language-name 'documentation)))) | |
435 (error "Bogus calling sequence")) | |
436 (with-output-to-temp-buffer "*Help*" | |
437 (if (stringp doc) | |
438 (princ-list doc) | |
439 (if (and (listp doc) | |
440 (stringp (car doc))) | |
441 (princ-list (car doc))) | |
442 (princ "-----------------------------------------------------------\n") | |
443 (princ-list "List of items specific to " | |
444 language-name | |
445 " support") | |
446 (princ "-----------------------------------------------------------\n") | |
447 (let ((str (get-language-info language-name 'sample-text))) | |
448 (if (stringp str) | |
449 (progn | |
450 (princ "<sample text>\n") | |
451 (princ-list " " str)))) | |
452 (princ "<input methods>\n") | |
453 (let ((l (get-language-info language-name 'input-method))) | |
454 (while l | |
455 (princ-list " " (car (car l))) | |
456 (setq l (cdr l)))) | |
457 (princ "<character sets>\n") | |
458 (let ((l (get-language-info language-name 'charset))) | |
459 (if (null l) | |
460 (princ-list " nothing specific to " language-name) | |
461 (while l | |
462 (princ-list " " (car l) ": " | |
463 (charset-description (car l))) | |
464 (setq l (cdr l))))) | |
465 (princ "<coding systems>\n") | |
466 (let ((l (get-language-info language-name 'coding-system))) | |
467 (if (null l) | |
468 (princ-list " nothing specific to " language-name) | |
469 (while l | |
470 (princ-list " " (car l) ":\n\t" | |
471 (coding-system-docstring (car l))) | |
472 (setq l (cdr l))))))))) | |
473 | |
422 (defun describe-language-support (language-name) | 474 (defun describe-language-support (language-name) |
423 "Describe how Emacs supports LANGUAGE-NAME. | 475 "Describe how Emacs supports LANGUAGE-NAME." |
424 | |
425 For that, a function returned by: | |
426 (get-language-info LANGUAGE-NAME 'describe-function) | |
427 is called." | |
428 (interactive (list (read-language-name 'documentation "Language: "))) | 476 (interactive (list (read-language-name 'documentation "Language: "))) |
429 (let (func) | 477 (if (or (null language-name) |
430 (if (or (null language-name) | 478 (null (get-language-info language-name 'documentation))) |
431 (null (setq func | 479 (error "No documentation for the specified language")) |
432 (get-language-info language-name 'describe-function)))) | 480 (let ((last-command-event (intern language-name))) |
433 (error "No documentation for the specified language")) | 481 (describe-specified-language-support))) |
434 (funcall func))) | |
435 | |
436 ;; Print LANGUAGE-NAME specific information such as input methods, | |
437 ;; charsets, and coding systems. This function is intended to be | |
438 ;; called from various describe-LANGUAGE-support functions defined in | |
439 ;; lisp/language/LANGUAGE.el. | |
440 (defun describe-language-support-internal (language-name) | |
441 (with-output-to-temp-buffer "*Help*" | |
442 (let ((doc (get-language-info language-name 'documentation))) | |
443 (if (stringp doc) | |
444 (princ-list doc))) | |
445 (princ "-----------------------------------------------------------\n") | |
446 (princ-list "List of items specific to " | |
447 language-name | |
448 " support") | |
449 (princ "-----------------------------------------------------------\n") | |
450 (let ((str (get-language-info language-name 'sample-text))) | |
451 (if (stringp str) | |
452 (progn | |
453 (princ "<sample text>\n") | |
454 (princ-list " " str)))) | |
455 (princ "<input methods>\n") | |
456 (let ((l (get-language-info language-name 'input-method))) | |
457 (while l | |
458 (princ-list " " (car (car l))) | |
459 (setq l (cdr l)))) | |
460 (princ "<character sets>\n") | |
461 (let ((l (get-language-info language-name 'charset))) | |
462 (if (null l) | |
463 (princ-list " nothing specific to " language-name) | |
464 (while l | |
465 (princ-list " " (car l) ": " | |
466 (charset-description (car l))) | |
467 (setq l (cdr l))))) | |
468 (princ "<coding systems>\n") | |
469 (let ((l (get-language-info language-name 'coding-system))) | |
470 (if (null l) | |
471 (princ-list " nothing specific to " language-name) | |
472 (while l | |
473 (princ-list " " (car l) ":\n\t" | |
474 (coding-system-docstring (car l))) | |
475 (setq l (cdr l))))))) | |
476 | 482 |
477 ;;; Charset property | 483 ;;; Charset property |
478 | 484 |
479 (defsubst get-charset-property (charset propname) | 485 (defsubst get-charset-property (charset propname) |
480 "Return the value of CHARSET's PROPNAME property. | 486 "Return the value of CHARSET's PROPNAME property. |