Mercurial > hg > xemacs-beta
comparison lisp/mule/mule-cmds.el @ 165:5a88923fcbfe r20-3b9
Import from CVS: tag r20-3b9
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:44:42 +0200 |
parents | 43dd3413c7c7 |
children | b405438285a2 |
comparison
equal
deleted
inserted
replaced
164:4e0740e5aab2 | 165:5a88923fcbfe |
---|---|
29 | 29 |
30 (defvar mule-keymap (make-sparse-keymap "MULE") | 30 (defvar mule-keymap (make-sparse-keymap "MULE") |
31 "Keymap for MULE (Multilingual environment) specific commands.") | 31 "Keymap for MULE (Multilingual environment) specific commands.") |
32 (fset 'mule-prefix mule-keymap) | 32 (fset 'mule-prefix mule-keymap) |
33 | 33 |
34 ;; Keep "C-x C-k ..." for mule specific commands. | 34 ;; Keep "C-x C-m ..." for mule specific commands. |
35 (define-key ctl-x-map "\C-k" 'mule-prefix) | 35 (define-key ctl-x-map "\C-m" 'mule-prefix) |
36 | 36 |
37 (defvar mule-describe-language-support-map | 37 ;; (defvar mule-describe-language-support-map |
38 (make-sparse-keymap "Describe Language Support")) | 38 ;; (make-sparse-keymap "Describe Language Support")) |
39 (fset 'mule-describe-language-support-prefix | 39 ;; (fset 'mule-describe-language-support-prefix |
40 mule-describe-language-support-map) | 40 ;; mule-describe-language-support-map) |
41 | 41 |
42 (defvar mule-set-language-environment-map | 42 ;; (defvar mule-set-language-environment-map |
43 (make-sparse-keymap "Set Language Environment")) | 43 ;; (make-sparse-keymap "Set Language Environment")) |
44 (fset 'mule-set-language-environment-prefix | 44 ;; (fset 'mule-set-language-environment-prefix |
45 mule-set-language-environment-map) | 45 ;; mule-set-language-environment-map) |
46 | 46 |
47 (define-key mule-keymap "f" 'set-buffer-file-coding-system) | 47 (define-key mule-keymap "f" 'set-buffer-file-coding-system) |
48 (define-key mule-keymap "F" 'set-default-buffer-file-coding-system) ; XEmacs | 48 (define-key mule-keymap "F" 'set-default-buffer-file-coding-system) ; XEmacs |
49 (define-key mule-keymap "t" 'set-terminal-coding-system) | 49 (define-key mule-keymap "t" 'set-terminal-coding-system) |
50 (define-key mule-keymap "k" 'set-keyboard-coding-system) | 50 (define-key mule-keymap "k" 'set-keyboard-coding-system) |
72 (define-key global-map "\C-\\" 'toggle-input-method) | 72 (define-key global-map "\C-\\" 'toggle-input-method) |
73 | 73 |
74 (defun view-hello-file () | 74 (defun view-hello-file () |
75 "Display the HELLO file which list up many languages and characters." | 75 "Display the HELLO file which list up many languages and characters." |
76 (interactive) | 76 (interactive) |
77 (find-file-read-only (expand-file-name "HELLO" data-directory))) | 77 ;; We have to decode the file in any environment. |
78 (let ((coding-system-for-read 'iso-2022-7)) | |
79 (find-file-read-only (expand-file-name "HELLO" data-directory)))) | |
78 | 80 |
79 | 81 |
80 ;;; Language support staffs. | 82 ;;; Language support staffs. |
81 | 83 |
82 (defvar primary-language "English" | 84 (defvar primary-language "English" |
84 Emacs provide various language supports based on this variable.") | 86 Emacs provide various language supports based on this variable.") |
85 | 87 |
86 (defvar language-info-alist nil | 88 (defvar language-info-alist nil |
87 "Alist of language names vs the corresponding information of various kind. | 89 "Alist of language names vs the corresponding information of various kind. |
88 Each element looks like: | 90 Each element looks like: |
89 (LANGUAGE-NAME . ((KEY . INFO) ...)) | 91 (LANGUAGE-NAME . ((KEY . INFO) ...)) |
90 where LANGUAGE-NAME is a string, | 92 where LANGUAGE-NAME is a string, |
91 KEY is a symbol denoting the kind of information, | 93 KEY is a symbol denoting the kind of information, |
92 INFO is any Lisp object which contains the actual information related | 94 INFO is any Lisp object which contains the actual information related |
93 to KEY.") | 95 to KEY.") |
94 | 96 |
96 "Return the information for LANGUAGE-NAME of the kind KEY. | 98 "Return the information for LANGUAGE-NAME of the kind KEY. |
97 LANGUAGE-NAME is a string. | 99 LANGUAGE-NAME is a string. |
98 KEY is a symbol denoting the kind of required information." | 100 KEY is a symbol denoting the kind of required information." |
99 (let ((lang-slot (assoc language-name language-info-alist))) | 101 (let ((lang-slot (assoc language-name language-info-alist))) |
100 (if lang-slot | 102 (if lang-slot |
101 (cdr (assq key (cdr lang-slot)))))) | 103 (cdr (assq key (cdr lang-slot)))))) |
102 | |
103 ;; Return a lambda form which calls `describe-language-support' with | |
104 ;; argument LANG. | |
105 (defun build-describe-language-support-function (lang) | |
106 `(lambda () | |
107 (interactive) | |
108 (describe-language-support ,lang))) | |
109 | |
110 ;; Return a lambda form which calls `set-language-environment' with | |
111 ;; argument LANG. | |
112 (defun build-set-language-environment-function (lang) | |
113 `(lambda () | |
114 (interactive) | |
115 (set-language-environment ,lang))) | |
116 | 104 |
117 (defun set-language-info (language-name key info) | 105 (defun set-language-info (language-name key info) |
118 "Set for LANGUAGE-NAME the information INFO under KEY. | 106 "Set for LANGUAGE-NAME the information INFO under KEY. |
119 LANGUAGE-NAME is a string | 107 LANGUAGE-NAME is a string |
120 KEY is a symbol denoting the kind of information. | 108 KEY is a symbol denoting the kind of information. |
121 INFO is any Lisp object which contains the actual information. | 109 INFO is any Lisp object which contains the actual information. |
122 | 110 |
123 Currently, the following KEYs are used by Emacs: | 111 Currently, the following KEYs are used by Emacs: |
124 charset: list of symbols whose values are charsets specific to the language. | 112 charset: list of symbols whose values are charsets specific to the language. |
125 coding-system: list of coding systems specific to the langauge. | 113 coding-system: list of coding systems specific to the langauge. |
126 setup-function: see the documentation of `set-language-environment'. | |
127 tutorial: a tutorial file name written in the language. | 114 tutorial: a tutorial file name written in the language. |
128 sample-text: one line short text containing characters of the language. | 115 sample-text: one line short text containing characters of the language. |
129 documentation: a docstring describing how the language is supported, | |
130 or a fuction to call to describe it, | |
131 or t which means call `describe-language-support' to describe it. | |
132 input-method: alist of input method names for the language vs information | 116 input-method: alist of input method names for the language vs information |
133 for activating them. Use `register-input-method' (which see) | 117 for activating them. Use `register-input-method' (which see) |
134 to add a new input method to the alist. | 118 to add a new input method to the alist. |
135 | 119 documentation: a string describing how Emacs supports the langauge. |
136 Emacs will use more KEYs in the future. To avoid the conflition, users | 120 describe-function: a function to call for descriebing how Emacs supports |
137 should use prefix \"user-\" in the name of KEY." | 121 the language. The function uses information listed abobe. |
122 setup-function: a function to call for setting up environment | |
123 convenient for the language. | |
124 | |
125 Emacs will use more KEYs in the future. To avoid conflict, users | |
126 should use prefix \"user-\" in the name of KEY if he wants to set | |
127 different kind of information." | |
138 (let (lang-slot key-slot) | 128 (let (lang-slot key-slot) |
139 (setq lang-slot (assoc language-name language-info-alist)) | 129 (setq lang-slot (assoc language-name language-info-alist)) |
140 (if (null lang-slot) ; If no slot for the language, add it. | 130 (if (null lang-slot) ; If no slot for the language, add it. |
141 (setq lang-slot (list language-name) | 131 (setq lang-slot (list language-name) |
142 language-info-alist (cons lang-slot language-info-alist))) | 132 language-info-alist (cons lang-slot language-info-alist))) |
143 (setq key-slot (assq key lang-slot)) | 133 (setq key-slot (assq key lang-slot)) |
144 (if (null key-slot) ; If no slot for the key, add it. | 134 (if (null key-slot) ; If no slot for the key, add it. |
145 (progn | 135 (progn |
146 (setq key-slot (list key)) | 136 (setq key-slot (list key)) |
147 (setcdr lang-slot (cons key-slot (cdr lang-slot))))) | 137 (setcdr lang-slot (cons key-slot (cdr lang-slot))))) |
148 (setcdr key-slot info) | 138 (setcdr key-slot info) |
149 ;; Setup menu. | 139 ;; Setup menu. |
150 (cond ((eq key 'documentation) | 140 (cond ((eq key 'describe-function) |
151 (define-key mule-describe-language-support-map | 141 ;; (define-key-after mule-describe-language-support-map |
152 (vector (intern language-name)) | 142 ;; (vector (intern language-name)) |
153 (cons language-name | 143 ;; (cons language-name info) |
154 (build-describe-language-support-function language-name)))) | 144 ;; t) |
155 ((eq key 'setup-function) | 145 (eval-after-load "x-menubar" |
156 (define-key mule-set-language-environment-map | 146 `(add-menu-button '("Mule" "Describe Language Support") |
157 (vector (intern language-name)) | 147 (vector ,language-name ',info t))) |
158 (cons language-name | 148 ) |
159 (build-set-language-environment-function language-name))))) | 149 ((eq key 'setup-function) |
150 ;; (define-key-after mule-set-language-environment-map | |
151 ;; (vector (intern language-name)) | |
152 ;; (cons language-name info) | |
153 ;; t) | |
154 (eval-after-load "x-menubar" | |
155 `(add-menu-button '("Mule" "Set Language Environment") | |
156 (vector ,language-name ',info t))) | |
157 )) | |
160 )) | 158 )) |
161 | 159 |
162 (defun set-language-info-alist (language-name alist) | 160 (defun set-language-info-alist (language-name alist) |
163 "Set for LANGUAGE-NAME the information in ALIST. | 161 "Set for LANGUAGE-NAME the information in ALIST. |
164 ALIST is an alist of KEY and INFO. See the documentation of | 162 ALIST is an alist of KEY and INFO. See the documentation of |
168 (setq alist (cdr alist)))) | 166 (setq alist (cdr alist)))) |
169 | 167 |
170 (defun read-language-name (key prompt &optional initial-input) | 168 (defun read-language-name (key prompt &optional initial-input) |
171 "Read language name which has information for KEY, prompting with PROMPT." | 169 "Read language name which has information for KEY, prompting with PROMPT." |
172 (let* ((completion-ignore-case t) | 170 (let* ((completion-ignore-case t) |
173 (name (completing-read prompt | 171 (name (completing-read prompt |
174 language-info-alist | 172 language-info-alist |
175 (function (lambda (elm) (assq key elm))) | 173 (function (lambda (elm) (assq key elm))) |
176 t | 174 t |
177 initial-input))) | 175 initial-input))) |
178 (and (> (length name) 0) | 176 (and (> (length name) 0) |
179 (car (assoc-ignore-case (downcase name) language-info-alist))))) | 177 (car (assoc-ignore-case (downcase name) language-info-alist))))) |
180 | 178 |
181 ;;; Multilingual input methods. | 179 ;;; Multilingual input methods. |
182 | 180 |
183 (defvar current-input-method nil | 181 (defvar current-input-method nil |
184 "The current input method for multilingual text. | 182 "The current input method for multilingual text. |
187 (make-variable-buffer-local 'current-input-method) | 185 (make-variable-buffer-local 'current-input-method) |
188 (put 'current-input-method 'permanent-local t) | 186 (put 'current-input-method 'permanent-local t) |
189 | 187 |
190 (defvar current-input-method-title nil | 188 (defvar current-input-method-title nil |
191 "Title string of the current input method shown in mode line. | 189 "Title string of the current input method shown in mode line. |
192 Every input method should set this an appropriate value when activated.") | 190 Every input method should set this to an appropriate value when activated.") |
193 (make-variable-buffer-local 'current-input-method-title) | 191 (make-variable-buffer-local 'current-input-method-title) |
194 (put 'current-input-method-title 'permanent-local t) | 192 (put 'current-input-method-title 'permanent-local t) |
195 | 193 |
196 (defvar default-input-method nil | 194 (defvar default-input-method nil |
197 "Default input method. | 195 "Default input method. |
222 | 220 |
223 (defun register-input-method (language-name input-method) | 221 (defun register-input-method (language-name input-method) |
224 "Register INPUT-METHOD as an input method of LANGUAGE-NAME. | 222 "Register INPUT-METHOD as an input method of LANGUAGE-NAME. |
225 LANGUAGE-NAME is a string. | 223 LANGUAGE-NAME is a string. |
226 INPUT-METHOD is a list of the form: | 224 INPUT-METHOD is a list of the form: |
227 (METHOD-NAME ACTIVATE-FUNC ARG ...) | 225 (METHOD-NAME ACTIVATE-FUNC ARG ...) |
228 where METHOD-NAME is the name of this method, | 226 where METHOD-NAME is the name of this method, |
229 ACTIVATE-FUNC is the function to call for activating this method. | 227 ACTIVATE-FUNC is the function to call for activating this method. |
230 Arguments for the function are METHOD-NAME and ARGs." | 228 Arguments for the function are METHOD-NAME and ARGs." |
231 (let ((slot (get-language-info language-name 'input-method)) | 229 (let ((slot (get-language-info language-name 'input-method)) |
232 method-slot) | 230 method-slot) |
240 | 238 |
241 (defun read-language-and-input-method-name () | 239 (defun read-language-and-input-method-name () |
242 "Read a language names and the corresponding input method from a minibuffer. | 240 "Read a language names and the corresponding input method from a minibuffer. |
243 Return a cons of those names." | 241 Return a cons of those names." |
244 (let ((language-name (read-language-name | 242 (let ((language-name (read-language-name |
245 'input-method | 243 'input-method |
246 "Language: " | 244 "Language: " |
247 (if previous-input-method | 245 (if previous-input-method |
248 (cons (car previous-input-method) 0))))) | 246 (cons (car previous-input-method) 0))))) |
249 (if (null language-name) | 247 (if (null language-name) |
250 (error "No input method for the specified language")) | 248 (error "No input method for the specified language")) |
251 (let* ((completion-ignore-case t) | 249 (let* ((completion-ignore-case t) |
252 (key-slot (cdr (assq 'input-method | 250 (key-slot (cdr (assq 'input-method |
253 (assoc language-name language-info-alist)))) | 251 (assoc language-name language-info-alist)))) |
254 (method-name | 252 (method-name |
255 (completing-read "Input method: " key-slot nil t | 253 (completing-read "Input method: " key-slot nil t |
256 (if (and previous-input-method | 254 (if (and previous-input-method |
257 (string= language-name | 255 (string= language-name |
258 (car previous-input-method))) | 256 (car previous-input-method))) |
259 (cons (cdr previous-input-method) 0))))) | 257 (cons (cdr previous-input-method) 0))))) |
260 (if (= (length method-name) 0) | 258 (if (= (length method-name) 0) |
261 (error "No input method specified")) | 259 (error "No input method specified")) |
262 (list language-name | 260 (list language-name |
263 (car (assoc-ignore-case (downcase method-name) key-slot)))))) | 261 (car (assoc-ignore-case (downcase method-name) key-slot)))))) |
264 | 262 |
265 (defun set-default-input-method (language-name method-name) | 263 (defun set-default-input-method (language-name method-name) |
266 "Set the default input method to METHOD-NAME for inputting LANGUAGE-NAME. | 264 "Set the default input method to METHOD-NAME for inputting LANGUAGE-NAME. |
267 The default input method is the one activated automatically by the command | 265 The default input method is the one activated automatically by the command |
268 `toggle-input-method' (\\[toggle-input-method]). | 266 `toggle-input-method' (\\[toggle-input-method]). |
277 (defun select-input-method (language-name method-name) | 275 (defun select-input-method (language-name method-name) |
278 "Select and activate input method METHOD-NAME for inputting LANGUAGE-NAME. | 276 "Select and activate input method METHOD-NAME for inputting LANGUAGE-NAME. |
279 The information for activating METHOD-NAME is stored | 277 The information for activating METHOD-NAME is stored |
280 in `language-info-alist' under the key 'input-method. | 278 in `language-info-alist' under the key 'input-method. |
281 The format of the information has the form: | 279 The format of the information has the form: |
282 ((METHOD-NAME ACTIVATE-FUNC ARG ...) ...) | 280 ((METHOD-NAME ACTIVATE-FUNC ARG ...) ...) |
283 where ACTIVATE-FUNC is a function to call for activating this method. | 281 where ACTIVATE-FUNC is a function to call for activating this method. |
284 Arguments for the function are METHOD-NAME and ARGs." | 282 Arguments for the function are METHOD-NAME and ARGs." |
285 (interactive (read-language-and-input-method-name)) | 283 (interactive (read-language-and-input-method-name)) |
286 (let* ((key-slot (get-language-info language-name 'input-method)) | 284 (let* ((key-slot (get-language-info language-name 'input-method)) |
287 (method-slot (assoc method-name key-slot))) | 285 (method-slot (assoc method-name key-slot))) |
288 (if (null method-slot) | 286 (if (null method-slot) |
289 (error "No input method `%s' for %s" method-name language-name)) | 287 (error "No input method `%s' for %s" method-name language-name)) |
290 (if current-input-method | 288 (if current-input-method |
291 (progn | 289 (progn |
292 (if (not (equal previous-input-method current-input-method)) | 290 (if (not (equal previous-input-method current-input-method)) |
293 (setq previous-input-method current-input-method)) | 291 (setq previous-input-method current-input-method)) |
294 (funcall inactivate-current-input-method-function))) | 292 (funcall inactivate-current-input-method-function))) |
295 (setq method-slot (cdr method-slot)) | 293 (setq method-slot (cdr method-slot)) |
296 (apply (car method-slot) method-name (cdr method-slot)) | 294 (apply (car method-slot) method-name (cdr method-slot)) |
297 (setq default-input-method | 295 (setq default-input-method |
298 (setq current-input-method (cons language-name method-name))) | 296 (setq current-input-method (cons language-name method-name))) |
299 (setq default-input-method-title current-input-method-title) | 297 (setq default-input-method-title current-input-method-title) |
300 (setq current-input-method default-input-method))) | 298 (setq current-input-method default-input-method))) |
301 | 299 |
302 (defun toggle-input-method (&optional arg) | 300 (defun toggle-input-method (&optional arg) |
303 "Toggle whether a multilingual input method is activated in this buffer. | 301 "Toggle whether a multilingual input method is activated in this buffer. |
318 (defun describe-input-method () | 316 (defun describe-input-method () |
319 "Describe the current input method." | 317 "Describe the current input method." |
320 (interactive) | 318 (interactive) |
321 (if current-input-method | 319 (if current-input-method |
322 (if (and (symbolp describe-current-input-method-function) | 320 (if (and (symbolp describe-current-input-method-function) |
323 (fboundp describe-current-input-method-function)) | 321 (fboundp describe-current-input-method-function)) |
324 (funcall describe-current-input-method-function) | 322 (funcall describe-current-input-method-function) |
325 (message "No way to describe the current input method `%s'" | 323 (message "No way to describe the current input method `%s'" |
326 (cdr current-input-method)) | 324 (cdr current-input-method)) |
327 (ding)) | 325 (ding)) |
328 (message "No input method is activated now") | 326 (message "No input method is activated now") |
329 (ding))) | 327 (ding))) |
330 | 328 |
331 ;; (defun read-multilingual-string (prompt &optional initial-input | 329 (defun read-multilingual-string (prompt &optional initial-input |
332 ;; language-name method-name) | 330 language-name method-name) |
333 ;; "Read a multilingual string from minibuffer, prompting with string PROMPT. | 331 "Read a multilingual string from minibuffer, prompting with string PROMPT. |
334 ;; The input method selected last time is activated in minibuffer. | 332 The input method selected last time is activated in minibuffer. |
335 ;; If non-nil, second arg INITIAL-INPUT is a string to insert before reading. | 333 If non-nil, second arg INITIAL-INPUT is a string to insert before reading. |
336 ;; Optional 3rd and 4th arguments LANGUAGE-NAME and METHOD-NAME specify | 334 Optional 3rd and 4th arguments LANGUAGE-NAME and METHOD-NAME specify |
337 ;; the input method to be activated instead of the one selected last time." | 335 the input method to be activated instead of the one selected last time." |
338 ;; (let ((minibuffer-setup-hook '(toggle-input-method)) | 336 (let ((minibuffer-setup-hook '(toggle-input-method)) |
339 ;; (default-input-method default-input-method)) | 337 (default-input-method default-input-method)) |
340 ;; (if (and language-name method-name) | 338 (if (and language-name method-name) |
341 ;; (set-default-input-method language-name method-name)) | 339 (set-default-input-method language-name method-name)) |
342 ;; (read-string prompt initial-input))) | 340 (read-string prompt initial-input))) |
343 | 341 |
344 ;; Variables to control behavior of input methods. All input methods | 342 ;; Variables to control behavior of input methods. All input methods |
345 ;; should react to these variables. | 343 ;; should react to these variables. |
346 | 344 |
347 (defvar input-method-tersely-flag nil | 345 (defvar input-method-tersely-flag nil |
348 "*If this flag is non-nil, input method works rather tersely. | 346 "*If this flag is non-nil, input method works rather tersely. |
349 | 347 |
350 For instance, Quail input method does not show guidance buffer while | 348 For instance, Quail input method does not show guidance buffer while |
351 inputting at minibuffer if this flag is t.") | 349 inputting at minibuffer if this flag is t.") |
352 | 350 |
353 ;; (defvar input-method-activate-hook nil | 351 (defvar input-method-activate-hook nil |
354 ;; "Normal hook run just after an input method is activated.") | 352 "Normal hook run just after an input method is activated.") |
355 | 353 |
356 ;; (defvar input-method-inactivate-hook nil | 354 (defvar input-method-inactivate-hook nil |
357 ;; "Normal hook run just after an input method is inactivated.") | 355 "Normal hook run just after an input method is inactivated.") |
358 | 356 |
359 ;; (defvar input-method-after-insert-chunk-hook nil | 357 (defvar input-method-after-insert-chunk-hook nil |
360 ;; "Normal hook run just after an input method insert some chunk of text.") | 358 "Normal hook run just after an input method insert some chunk of text.") |
361 | 359 |
362 | 360 |
363 ;;; Language specific setup functions. | 361 ;;; Language specific setup functions. |
364 ;; (defun set-language-environment (language-name) | 362 ;; (defun set-language-environment (language-name) |
365 ;; "Setup a user's environment for LANGUAGE-NAME. | 363 ;; "Setup a user's environment for LANGUAGE-NAME. |
379 (defsubst princ-list (&rest args) | 377 (defsubst princ-list (&rest args) |
380 (while args (princ (car args)) (setq args (cdr args))) | 378 (while args (princ (car args)) (setq args (cdr args))) |
381 (princ "\n")) | 379 (princ "\n")) |
382 | 380 |
383 (defun describe-language-support (language-name) | 381 (defun describe-language-support (language-name) |
384 "Show documentation about how Emacs supports LANGUAGE-NAME." | 382 "Describe how Emacs supports LANGUAGE-NAME. |
383 | |
384 For that, a function returned by: | |
385 (get-language-info LANGUAGE-NAME 'describe-function) | |
386 is called." | |
385 (interactive (list (read-language-name 'documentation "Language: "))) | 387 (interactive (list (read-language-name 'documentation "Language: "))) |
386 (let (doc) | 388 (let (func) |
387 (if (or (null language-name) | 389 (if (or (null language-name) |
388 (null (setq doc | 390 (null (setq func |
389 (get-language-info language-name 'documentation)))) | 391 (get-language-info language-name 'describe-function)))) |
390 (error "No documentation for the specified language")) | 392 (error "No documentation for the specified language")) |
391 (with-output-to-temp-buffer "*Help*" | 393 (funcall func))) |
392 (if (not (eq doc t)) | 394 |
393 (cond ((stringp doc) | 395 ;; Print LANGUAGE-NAME specific information such as input methods, |
394 (princ doc)) | 396 ;; charsets, and coding systems. This function is intended to be |
395 ((and (symbolp doc) (fboundp doc)) | 397 ;; called from various describe-LANGUAGE-support functions defined in |
396 (funcall doc)) | 398 ;; lisp/language/LANGUAGE.el. |
397 (t | 399 (defun describe-language-support-internal (language-name) |
398 (error "Invalid documentation data for %s" language-name))) | 400 (with-output-to-temp-buffer "*Help*" |
399 (princ-list "List of items specific to " | 401 (let ((doc (get-language-info language-name 'documentation))) |
400 language-name | 402 (if (stringp doc) |
401 " environment") | 403 (princ-list doc))) |
402 (princ "-----------------------------------------------------------\n") | 404 (princ "-----------------------------------------------------------\n") |
403 (let ((str (get-language-info language-name 'sample-text))) | 405 (princ-list "List of items specific to " |
404 (if (stringp str) | 406 language-name |
405 (progn | 407 " support") |
406 (princ "<sample text>\n") | 408 (princ "-----------------------------------------------------------\n") |
407 (princ-list " " str)))) | 409 (let ((str (get-language-info language-name 'sample-text))) |
408 (princ "<input methods>\n") | 410 (if (stringp str) |
409 (let ((l (get-language-info language-name 'input-method))) | 411 (progn |
410 (while l | 412 (princ "<sample text>\n") |
411 (princ-list " " (car (car l))) | 413 (princ-list " " str)))) |
412 (setq l (cdr l)))) | 414 (princ "<input methods>\n") |
413 (princ "<character sets>\n") | 415 (let ((l (get-language-info language-name 'input-method))) |
414 (let ((l (get-language-info language-name 'charset))) | 416 (while l |
415 (if (null l) | 417 (princ-list " " (car (car l))) |
416 (princ-list " nothing specific to " language-name) | 418 (setq l (cdr l)))) |
417 (while l | 419 (princ "<character sets>\n") |
418 (princ-list " " (car l) | 420 (let ((l (get-language-info language-name 'charset))) |
419 (format ":%3d:\n\t" (charset-id (car l))) | 421 (if (null l) |
420 (charset-description (car l))) | 422 (princ-list " nothing specific to " language-name) |
421 (setq l (cdr l))))) | 423 (while l |
422 (princ "<coding systems>\n") | 424 (princ-list " " (car l) ": " |
423 (let ((l (get-language-info language-name 'coding-system))) | 425 (charset-description (car l))) |
424 (if (null l) | 426 (setq l (cdr l))))) |
425 (princ-list " nothing specific to " language-name) | 427 (princ "<coding systems>\n") |
426 (while l | 428 (let ((l (get-language-info language-name 'coding-system))) |
427 (princ-list " " (car l) ":\n\t" | 429 (if (null l) |
428 (coding-system-docstring (car l))) | 430 (princ-list " nothing specific to " language-name) |
429 (setq l (cdr l))))))))) | 431 (while l |
432 (princ-list " " (car l) ":\n\t" | |
433 (coding-system-docstring (car l))) | |
434 (setq l (cdr l))))))) | |
430 | 435 |
431 ;;; Charset property | 436 ;;; Charset property |
432 | 437 |
433 ;; (defsubst get-charset-property (charset propname) | 438 ;; (defsubst get-charset-property (charset propname) |
434 ;; "Return the value of CHARSET's PROPNAME property. | 439 ;; "Return the value of CHARSET's PROPNAME property. |
467 ;; (if slot | 472 ;; (if slot |
468 ;; (setcar (cdr slot) value) | 473 ;; (setcar (cdr slot) value) |
469 ;; (nconc plist (list propname value)))) | 474 ;; (nconc plist (list propname value)))) |
470 ;; (aset char-code-property-table char (list propname value))))) | 475 ;; (aset char-code-property-table char (list propname value))))) |
471 | 476 |
472 (provide 'mule-cmds) | |
473 | |
474 ;;; mule-cmds.el ends here | 477 ;;; mule-cmds.el ends here |