502
|
1 ;;; mule-cmds.el --- Commands for multilingual environment -*- coding: iso-2022-7bit; -*-
|
428
|
2
|
|
3 ;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN.
|
|
4 ;; Licensed to the Free Software Foundation.
|
|
5 ;; Copyright (C) 1997 MORIOKA Tomohiko
|
1318
|
6 ;; Copyright (C) 2000, 2001, 2002, 2003 Ben Wing.
|
428
|
7
|
|
8 ;; Keywords: mule, multilingual
|
|
9
|
|
10 ;; This file is part of XEmacs.
|
|
11
|
|
12 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
13 ;; under the terms of the GNU General Public License as published by
|
|
14 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
15 ;; any later version.
|
|
16
|
|
17 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20 ;; General Public License for more details.
|
|
21
|
|
22 ;; You should have received a copy of the GNU General Public License
|
|
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
25 ;; 02111-1307, USA.
|
|
26
|
444
|
27 ;; Note: Some of the code here is now in code-cmds.el
|
|
28
|
428
|
29 ;;; Code:
|
|
30
|
|
31 ;;; MULE related key bindings and menus.
|
|
32
|
444
|
33 ;; Preserve the old name
|
|
34 (defvaralias 'mule-keymap 'coding-keymap)
|
|
35
|
428
|
36 (define-key mule-keymap "x" 'set-selection-coding-system)
|
|
37 (define-key mule-keymap "X" 'set-next-selection-coding-system)
|
|
38 (define-key mule-keymap "\C-\\" 'set-input-method)
|
|
39 ;;(define-key mule-keymap "c" 'list-coding-system-briefly) ; XEmacs
|
|
40 (define-key mule-keymap "C" 'describe-coding-system) ; XEmacs
|
|
41 (define-key mule-keymap "r" 'toggle-display-direction) ; XEmacs
|
|
42 (define-key mule-keymap "l" 'set-language-environment)
|
|
43
|
|
44 (define-key help-map "L" 'describe-language-environment)
|
|
45 (define-key help-map "\C-\\" 'describe-input-method)
|
|
46 (define-key help-map "I" 'describe-input-method)
|
|
47 (define-key help-map "h" 'view-hello-file)
|
|
48
|
|
49 ;; Menu for XEmacs were moved to menubar-items.el.
|
|
50
|
|
51
|
|
52 ;; This should be a single character key binding because users use it
|
|
53 ;; very frequently while editing multilingual text. Now we can use
|
|
54 ;; only two such keys: "\C-\\" and "\C-^", but the latter is not
|
|
55 ;; convenient because it requires shifting on most keyboards. An
|
|
56 ;; alternative is "\C-\]" which is now bound to `abort-recursive-edit'
|
|
57 ;; but it won't be used that frequently.
|
|
58 (define-key global-map "\C-\\" 'toggle-input-method)
|
|
59
|
771
|
60 ;; Original mapping will be altered by set-keyboard-coding-system.
|
|
61 (define-key global-map [(meta \#)] 'ispell-word) ;originally "$"
|
|
62 ;; (define-key global-map [(meta {)] 'insert-parentheses) ;originally "("
|
|
63
|
428
|
64 ;;; This is no good because people often type Shift-SPC
|
|
65 ;;; meaning to type SPC. -- rms.
|
|
66 ;;; ;; Here's an alternative key binding for X users (Shift-SPACE).
|
771
|
67 ;;; (define-key global-map '(shift space) 'toggle-input-method)
|
428
|
68
|
|
69 (defun view-hello-file ()
|
|
70 "Display the HELLO file which list up many languages and characters."
|
|
71 (interactive)
|
|
72 ;; We have to decode the file in any environment.
|
|
73 (let ((coding-system-for-read 'iso-2022-7bit))
|
|
74 (find-file-read-only (expand-file-name "HELLO" data-directory))))
|
|
75
|
|
76
|
771
|
77 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
78 ;;; Language Support Functions ;;;
|
|
79 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
428
|
80 (defvar language-info-alist nil
|
|
81 "Alist of language environment definitions.
|
|
82 Each element looks like:
|
771
|
83 (LANGUAGE-NAME . ((PROP . VALUE) ...))
|
428
|
84 where LANGUAGE-NAME is a string, the name of the language environment,
|
771
|
85 PROP is a symbol denoting a property, and VALUE is the data associated
|
|
86 with PROP.
|
|
87 See `set-language-info' for documentation on PROP and VALUE.")
|
428
|
88
|
771
|
89 (defun get-language-info (lang-env prop)
|
|
90 "Return information listed under PROP for language environment LANG-ENV.
|
|
91 PROP is a symbol denoting a property.
|
|
92 For a list of useful values for PROP and their meanings,
|
|
93 see `set-language-info'."
|
428
|
94 (if (symbolp lang-env)
|
|
95 (setq lang-env (symbol-name lang-env)))
|
|
96 (let ((lang-slot (assoc-ignore-case lang-env language-info-alist)))
|
|
97 (if lang-slot
|
771
|
98 (cdr (assq prop (cdr lang-slot))))))
|
428
|
99
|
771
|
100 (defun set-language-info (lang-env prop value)
|
428
|
101 "Modify part of the definition of language environment LANG-ENV.
|
771
|
102 Specifically, this stores the information VALUE under PROP
|
428
|
103 in the definition of this language environment.
|
771
|
104 PROP is a symbol denoting a property, and VALUE is the value of that property.
|
|
105
|
|
106 Meaningful values for PROP include
|
|
107
|
|
108 documentation VALUE is documentation of what this language environment
|
|
109 is meant for, and how to use it.
|
|
110
|
|
111 charset VALUE is a list of the character sets used by this
|
|
112 language environment.
|
|
113
|
|
114 sample-text VALUE is one line of text,
|
|
115 written using those character sets,
|
|
116 appropriate for this language environment.
|
|
117
|
|
118 setup-function VALUE is a function to call to switch to this
|
|
119 language environment.
|
|
120
|
|
121 exit-function VALUE is a function to call to leave this
|
|
122 language environment.
|
|
123
|
|
124 coding-system VALUE is a list of coding systems that are good
|
|
125 for saving text written in this language environment.
|
|
126 This list serves as suggestions to the user;
|
|
127 in effect, as a kind of documentation.
|
|
128
|
|
129 coding-priority VALUE is a list of coding systems for this language
|
|
130 environment, in order of decreasing priority.
|
|
131 This is used to set up the coding system priority
|
|
132 list when you switch to this language environment.
|
|
133
|
|
134 input-method VALUE is a default input method for this language
|
|
135 environment.
|
|
136
|
|
137 features VALUE is a list of features requested in this
|
|
138 language environment.
|
|
139
|
|
140 tutorial VALUE is a tutorial file name written in the language.
|
|
141
|
|
142 locale VALUE is a list of locale expressions, which serve
|
|
143 two purposes: (1) Determining the language
|
|
144 environment from the current system locale at
|
|
145 startup, and (2) determining how to set the system
|
|
146 locale when the language environment is changed.
|
|
147 Each expression will be tried in turn, and should
|
|
148 be a string (for case (1), the string is matched
|
|
149 against the current locale using the regular
|
|
150 expression \"^STRING[^A-Za-z0-9]\"; for case (2),
|
|
151 the string is passed directly to
|
|
152 `set-current-locale' until a non-nil result is
|
|
153 returned), or a function of one argument. For
|
|
154 case (1), this argument will be a locale, and the
|
|
155 function should return t or nil to indicate
|
|
156 whether this locale matches the language
|
|
157 environment; for case (2), the argument will be
|
|
158 nil, and the function should call
|
|
159 `set-current-locale' itself and return the set
|
|
160 locale string if the locale was successfully set,
|
|
161 and nil otherwise.
|
428
|
162
|
771
|
163 NOTE: This property is *NOT* used under MS Windows;
|
|
164 instead, the `mswindows-locale' property is used.
|
|
165
|
|
166 cygwin-locale VALUE specifies a general Unix-style C library
|
|
167 locale that will be used to initialize the LANG
|
|
168 environment variable under MS Windows native, when the
|
|
169 system cannot test out the locales specified in the
|
|
170 `locale' property. This is so that Cygwin programs
|
|
171 can be run from an MS Windows native XEmacs. If not
|
|
172 specified, the last entry in `locale' will be used.
|
|
173
|
|
174 native-coding-system VALUE is a single coding-system expression, or a
|
|
175 list of such expressions. These expressions are
|
|
176 used to compute the operating system's native
|
|
177 coding system, i.e. the coding system to be used
|
|
178 as the alias for `native' and `file-name'. This
|
|
179 specifies the coding system used for text
|
|
180 exchanged with the operating system, such as file
|
|
181 names, environment variables, subprocess
|
|
182 arguments, etc. Each expression should be either
|
|
183 a symbol naming a coding system or a function
|
|
184 (anything that is `functionp') of one argument,
|
|
185 which is passed the current locale corresponding
|
|
186 to this language environment and should return a
|
|
187 coding system or nil. Each expression is tried in
|
|
188 turn until a coding system is obtained. If there
|
|
189 is no non-nil result, or no value is specified for
|
|
190 this property, the first coding system listed
|
|
191 under the `coding-system' property is used.
|
|
192
|
|
193 NOTE: This is *NOT* used under MS Windows.
|
|
194 Instead, `mswindows-multibyte-system-default'
|
|
195 is always used, since the system default code
|
|
196 page is what the Win32 API routines make use
|
|
197 of, and this cannot be changed. (We get around
|
|
198 this by using the Unicode versions whenever
|
|
199 possible -- i.e. on Windows NT/2000, and on
|
|
200 Windows 9x with the few API's that support
|
|
201 Unicode.)
|
|
202
|
|
203 mswindows-locale VALUE is an element of the form MSWINDOWS-LOCALE, or
|
|
204 a list of such elements. Each element is an MS
|
|
205 Windows locale, of the form that can be passed to
|
|
206 `mswindows-set-current-locale'. This property is used
|
|
207 both to determine the current language environment at
|
|
208 startup (by matching MSWINDOWS-LOCALE against the
|
|
209 value returned by `mswindows-user-default-locale') and
|
|
210 to set the values of `set-current-locale' and
|
|
211 `mswindows-set-current-locale' when the current
|
|
212 language environment is changed. (The correct CLIB
|
|
213 locale can always be generated by passing in the
|
|
214 SUBLANG, with dashes in place of underscores, or the
|
|
215 LANG if there's no SUBLANG. The return value will be
|
|
216 the canonicalized locale, in proper CLIB form.)
|
|
217
|
|
218 If there is no value for this property, the MS Windows
|
|
219 locale is assumed to have the same name as the
|
|
220 language environment."
|
428
|
221 (if (symbolp lang-env)
|
|
222 (setq lang-env (symbol-name lang-env)))
|
771
|
223 (let (lang-slot prop-slot)
|
428
|
224 (setq lang-slot (assoc lang-env language-info-alist))
|
|
225 (if (null lang-slot) ; If no slot for the language, add it.
|
|
226 (setq lang-slot (list lang-env)
|
|
227 language-info-alist (cons lang-slot language-info-alist)))
|
771
|
228 (setq prop-slot (assq prop lang-slot))
|
|
229 (if (null prop-slot) ; If no slot for the prop, add it.
|
428
|
230 (progn
|
771
|
231 (setq prop-slot (list prop))
|
|
232 (setcdr lang-slot (cons prop-slot (cdr lang-slot)))))
|
|
233 (setcdr prop-slot value)))
|
428
|
234
|
|
235 (defun set-language-info-alist (lang-env alist &optional parents)
|
|
236 "Store ALIST as the definition of language environment LANG-ENV.
|
771
|
237 ALIST is an alist of properties and values. See the documentation of
|
|
238 `set-language-info' for the allowed properties."
|
428
|
239 (if (symbolp lang-env)
|
|
240 (setq lang-env (symbol-name lang-env)))
|
771
|
241 ;; FSF has 30 lines of unbelievably ugly code to set up the menus
|
|
242 ;; appropriately. We just use a filter.
|
|
243 (while alist
|
|
244 (set-language-info lang-env (car (car alist)) (cdr (car alist)))
|
|
245 (setq alist (cdr alist))))
|
428
|
246
|
|
247 (defun read-language-name (key prompt &optional default)
|
|
248 "Read a language environment name which has information for KEY.
|
|
249 If KEY is nil, read any language environment.
|
|
250 Prompt with PROMPT. DEFAULT is the default choice of language environment.
|
|
251 This returns a language environment name as a string."
|
|
252 (let* ((completion-ignore-case t)
|
|
253 (name (completing-read prompt
|
|
254 language-info-alist
|
|
255 (and key
|
|
256 (function (lambda (elm) (assq key elm))))
|
|
257 t nil nil default)))
|
|
258 (if (and (> (length name) 0)
|
|
259 (or (not key)
|
|
260 (get-language-info name key)))
|
|
261 name)))
|
|
262
|
|
263 ;;; Multilingual input methods.
|
|
264
|
|
265 (defconst leim-list-file-name "leim-list.el"
|
|
266 "Name of LEIM list file.
|
|
267 This file contains a list of libraries of Emacs input methods (LEIM)
|
|
268 in the format of Lisp expression for registering each input method.
|
|
269 Emacs loads this file at startup time.")
|
|
270
|
|
271 (defvar leim-list-header (format
|
|
272 ";;; %s -- list of LEIM (Library of Emacs Input Method)
|
|
273 ;;
|
|
274 ;; This file contains a list of LEIM (Library of Emacs Input Method)
|
|
275 ;; in the same directory as this file. Loading this file registers
|
|
276 ;; the whole input methods in Emacs.
|
|
277 ;;
|
|
278 ;; Each entry has the form:
|
|
279 ;; (register-input-method
|
|
280 ;; INPUT-METHOD LANGUAGE-NAME ACTIVATE-FUNC
|
|
281 ;; TITLE DESCRIPTION
|
|
282 ;; ARG ...)
|
|
283 ;; See the function `register-input-method' for the meanings of arguments.
|
|
284 ;;
|
|
285 ;; If this directory is included in load-path, Emacs automatically
|
|
286 ;; loads this file at startup time.
|
|
287
|
|
288 "
|
|
289 leim-list-file-name)
|
|
290 "Header to be inserted in LEIM list file.")
|
|
291
|
|
292 (defvar leim-list-entry-regexp "^(register-input-method"
|
|
293 "Regexp matching head of each entry in LEIM list file.
|
|
294 See also the variable `leim-list-header'")
|
|
295
|
|
296 (defvar update-leim-list-functions
|
|
297 '(quail-update-leim-list-file)
|
|
298 "List of functions to call to update LEIM list file.
|
|
299 Each function is called with one arg, LEIM directory name.")
|
|
300
|
|
301 (defun update-leim-list-file (&rest dirs)
|
|
302 "Update LEIM list file in directories DIRS."
|
|
303 (let ((functions update-leim-list-functions))
|
|
304 (while functions
|
|
305 (apply (car functions) dirs)
|
|
306 (setq functions (cdr functions)))))
|
|
307
|
|
308 (defvar current-input-method nil
|
|
309 "The current input method for multilingual text.
|
|
310 If nil, that means no input method is activated now.")
|
|
311 (make-variable-buffer-local 'current-input-method)
|
|
312 (put 'current-input-method 'permanent-local t)
|
|
313
|
|
314 (defvar current-input-method-title nil
|
|
315 "Title string of the current input method shown in mode line.")
|
|
316 (make-variable-buffer-local 'current-input-method-title)
|
|
317 (put 'current-input-method-title 'permanent-local t)
|
|
318
|
|
319 (defcustom default-input-method nil
|
|
320 "*Default input method for multilingual text (a string).
|
|
321 This is the input method activated automatically by the command
|
|
322 `toggle-input-method' (\\[toggle-input-method])."
|
|
323 :group 'mule
|
|
324 :type '(choice (const nil) string))
|
|
325
|
|
326 (put 'input-method-function 'permanent-local t)
|
|
327
|
|
328 (defvar input-method-history nil
|
|
329 "History list for some commands that read input methods.")
|
|
330 (make-variable-buffer-local 'input-method-history)
|
|
331 (put 'input-method-history 'permanent-local t)
|
|
332
|
|
333 (defvar inactivate-current-input-method-function nil
|
|
334 "Function to call for inactivating the current input method.
|
|
335 Every input method should set this to an appropriate value when activated.
|
|
336 This function is called with no argument.
|
|
337
|
|
338 This function should never change the value of `current-input-method'.
|
|
339 It is set to nil by the function `inactivate-input-method'.")
|
|
340 (make-variable-buffer-local 'inactivate-current-input-method-function)
|
|
341 (put 'inactivate-current-input-method-function 'permanent-local t)
|
|
342
|
|
343 (defvar describe-current-input-method-function nil
|
|
344 "Function to call for describing the current input method.
|
|
345 This function is called with no argument.")
|
|
346 (make-variable-buffer-local 'describe-current-input-method-function)
|
|
347 (put 'describe-current-input-method-function 'permanent-local t)
|
|
348
|
|
349 (defvar input-method-alist nil
|
2970
|
350 "Alist mapping input method names to information used by the LEIM API.
|
|
351 Elements have the form (METHOD LANGUAGE ACTIVATOR TITLE DESCRIPTION ARGS...).
|
|
352 Use `register-input-method' to add input methods to the database. See its
|
|
353 documentation for the meanings of the elements.")
|
428
|
354
|
2970
|
355 (defun register-input-method (method language
|
|
356 ;; #### shouldn't be optional, but need to
|
|
357 ;; audit callers
|
|
358 &optional activator title description
|
|
359 &rest args)
|
|
360 "Register METHOD as an input method for language environment LANGUAGE.
|
428
|
361
|
2970
|
362 METHOD and LANGUAGE may be symbols or strings.
|
|
363 ACTIVATOR is the function called to activate this method. METHOD (the
|
|
364 invocation name) and ARGS are passed to the function on activation.
|
428
|
365 TITLE is a string to show in the mode line when this method is active.
|
|
366 DESCRIPTION is a string describing this method and what it is good for.
|
2970
|
367 Optional ARGS, if any, are stored and passed as arguments to ACTIVATOR.
|
428
|
368
|
2970
|
369 When registering a new Quail input method, the input method title should be
|
|
370 the one given in the third parameter of `quail-define-package' (if the values
|
|
371 are different, the string specified in this function takes precedence).
|
428
|
372
|
2970
|
373 The information provided is registered in `input-method-alist'. The commands
|
|
374 `describe-input-method' and `list-input-methods' use this database to show
|
|
375 information about input methods without loading them."
|
|
376 (if (symbolp language)
|
|
377 (setq language (symbol-name language)))
|
|
378 (if (symbolp method)
|
|
379 (setq method (symbol-name method)))
|
|
380 (let ((info (append (list language activator title description) args))
|
|
381 (slot (assoc method input-method-alist)))
|
428
|
382 (if slot
|
|
383 (setcdr slot info)
|
2970
|
384 (setq slot (cons method info))
|
428
|
385 (setq input-method-alist (cons slot input-method-alist)))))
|
|
386
|
|
387 (defun read-input-method-name (prompt &optional default inhibit-null)
|
|
388 "Read a name of input method from a minibuffer prompting with PROMPT.
|
|
389 If DEFAULT is non-nil, use that as the default,
|
|
390 and substitute it into PROMPT at the first `%s'.
|
|
391 If INHIBIT-NULL is non-nil, null input signals an error.
|
|
392
|
|
393 The return value is a string."
|
|
394 (if default
|
|
395 (setq prompt (format prompt default)))
|
|
396 (let* ((completion-ignore-case t)
|
|
397 ;; This binding is necessary because input-method-history is
|
|
398 ;; buffer local.
|
|
399 (input-method (completing-read prompt input-method-alist
|
|
400 nil t nil 'input-method-history
|
|
401 default)))
|
|
402 (if (and input-method (symbolp input-method))
|
|
403 (setq input-method (symbol-name input-method)))
|
|
404 (if (> (length input-method) 0)
|
|
405 input-method
|
|
406 (if inhibit-null
|
|
407 (error "No valid input method is specified")))))
|
|
408
|
|
409 (defun activate-input-method (input-method)
|
|
410 "Switch to input method INPUT-METHOD for the current buffer.
|
|
411 If some other input method is already active, turn it off first.
|
|
412 If INPUT-METHOD is nil, deactivate any current input method."
|
|
413 (if (and input-method (symbolp input-method))
|
|
414 (setq input-method (symbol-name input-method)))
|
|
415 (if (and current-input-method
|
|
416 (not (string= current-input-method input-method)))
|
|
417 (inactivate-input-method))
|
|
418 (unless (or current-input-method (null input-method))
|
|
419 (let ((slot (assoc input-method input-method-alist)))
|
|
420 (if (null slot)
|
|
421 (error "Can't activate input method `%s'" input-method))
|
|
422 (let ((func (nth 2 slot)))
|
|
423 (if (functionp func)
|
|
424 (apply (nth 2 slot) input-method (nthcdr 5 slot))
|
|
425 (if (and (consp func) (symbolp (car func)) (symbolp (cdr func)))
|
|
426 (progn
|
|
427 (require (cdr func))
|
|
428 (apply (car func) input-method (nthcdr 5 slot)))
|
|
429 (error "Can't activate input method `%s'" input-method))))
|
|
430 (setq current-input-method input-method)
|
|
431 (setq current-input-method-title (nth 3 slot))
|
|
432 (unwind-protect
|
|
433 (run-hooks 'input-method-activate-hook)
|
|
434 (force-mode-line-update)))))
|
|
435
|
|
436 (defun inactivate-input-method ()
|
|
437 "Turn off the current input method."
|
|
438 (when current-input-method
|
|
439 (if input-method-history
|
|
440 (unless (string= current-input-method (car input-method-history))
|
|
441 (setq input-method-history
|
|
442 (cons current-input-method
|
|
443 (delete current-input-method input-method-history))))
|
|
444 (setq input-method-history (list current-input-method)))
|
|
445 (unwind-protect
|
|
446 (funcall inactivate-current-input-method-function)
|
|
447 (unwind-protect
|
|
448 (run-hooks 'input-method-inactivate-hook)
|
|
449 (setq current-input-method nil
|
|
450 current-input-method-title nil)
|
|
451 (force-mode-line-update)))))
|
|
452
|
|
453 (defun set-input-method (input-method)
|
|
454 "Select and activate input method INPUT-METHOD for the current buffer.
|
|
455 This also sets the default input method to the one you specify."
|
|
456 (interactive
|
|
457 (let* ((default (or (car input-method-history) default-input-method)))
|
|
458 (list (read-input-method-name
|
|
459 (if default "Select input method (default %s): " "Select input method: ")
|
|
460 default t))))
|
|
461 (activate-input-method input-method)
|
|
462 (setq default-input-method input-method))
|
|
463
|
|
464 (defun toggle-input-method (&optional arg)
|
|
465 "Turn on or off a multilingual text input method for the current buffer.
|
|
466
|
|
467 With no prefix argument, if an input method is currently activated,
|
|
468 turn it off. Otherwise, activate an input method -- the one most
|
|
469 recently used, or the one specified in `default-input-method', or
|
|
470 the one read from the minibuffer.
|
|
471
|
|
472 With a prefix argument, read an input method from the minibuffer and
|
|
473 turn it on.
|
|
474
|
|
475 The default is to use the most recent input method specified
|
|
476 \(not including the currently active input method, if any)."
|
|
477 (interactive "P")
|
|
478 (if (and current-input-method (not arg))
|
|
479 (inactivate-input-method)
|
|
480 (let ((default (or (car input-method-history) default-input-method)))
|
|
481 (if (and arg default (equal current-input-method default)
|
|
482 (> (length input-method-history) 1))
|
|
483 (setq default (nth 1 input-method-history)))
|
|
484 (activate-input-method
|
|
485 (if (or arg (not default))
|
|
486 (progn
|
|
487 (read-input-method-name
|
|
488 (if default "Input method (default %s): " "Input method: " )
|
|
489 default t))
|
|
490 default))
|
|
491 (or default-input-method
|
|
492 (setq default-input-method current-input-method)))))
|
|
493
|
|
494 (defun describe-input-method (input-method)
|
|
495 "Describe input method INPUT-METHOD."
|
|
496 (interactive
|
|
497 (list (read-input-method-name
|
|
498 "Describe input method (default, current choice): ")))
|
|
499 (if (and input-method (symbolp input-method))
|
|
500 (setq input-method (symbol-name input-method)))
|
|
501 (if (null input-method)
|
|
502 (describe-current-input-method)
|
|
503 (with-output-to-temp-buffer "*Help*"
|
|
504 (let ((elt (assoc input-method input-method-alist)))
|
|
505 (princ (format "Input method: %s (`%s' in mode line) for %s\n %s\n"
|
|
506 input-method (nth 3 elt) (nth 1 elt) (nth 4 elt)))))))
|
|
507
|
|
508 (defun describe-current-input-method ()
|
|
509 "Describe the input method currently in use."
|
|
510 (if current-input-method
|
|
511 (if (and (symbolp describe-current-input-method-function)
|
|
512 (fboundp describe-current-input-method-function))
|
|
513 (funcall describe-current-input-method-function)
|
|
514 (message "No way to describe the current input method `%s'"
|
|
515 current-input-method)
|
|
516 (ding))
|
|
517 (error "No input method is activated now")))
|
|
518
|
|
519 (defun read-multilingual-string (prompt &optional initial-input input-method)
|
|
520 "Read a multilingual string from minibuffer, prompting with string PROMPT.
|
|
521 The input method selected last time is activated in minibuffer.
|
|
522 If optional second arg INITIAL-INPUT is non-nil, insert it in the minibuffer
|
|
523 initially.
|
|
524 Optional 3rd argument INPUT-METHOD specifies the input method
|
|
525 to be activated instead of the one selected last time. It is a symbol
|
|
526 or a string."
|
|
527 (setq input-method
|
|
528 (or input-method
|
|
529 current-input-method
|
|
530 default-input-method
|
|
531 (read-input-method-name "Input method: " nil t)))
|
|
532 (if (and input-method (symbolp input-method))
|
|
533 (setq input-method (symbol-name input-method)))
|
|
534 (let ((prev-input-method current-input-method))
|
|
535 (unwind-protect
|
|
536 (progn
|
|
537 (activate-input-method input-method)
|
|
538 ;; FSF Emacs
|
|
539 ;; (read-string prompt initial-input nil nil t)
|
|
540 (read-string prompt initial-input nil))
|
|
541 (activate-input-method prev-input-method))))
|
|
542
|
|
543 ;; Variables to control behavior of input methods. All input methods
|
|
544 ;; should react to these variables.
|
|
545
|
|
546 (defcustom input-method-verbose-flag 'default
|
|
547 "*A flag to control extra guidance given by input methods.
|
|
548 The value should be nil, t, `complex-only', or `default'.
|
|
549
|
|
550 The extra guidance is done by showing list of available keys in echo
|
|
551 area. When you use the input method in the minibuffer, the guidance
|
|
552 is shown at the bottom short window (split from the existing window).
|
|
553
|
|
554 If the value is t, extra guidance is always given, if the value is
|
|
555 nil, extra guidance is always suppressed.
|
|
556
|
|
557 If the value is `complex-only', only complex input methods such as
|
|
558 `chinese-py' and `japanese' give extra guidance.
|
|
559
|
|
560 If the value is `default', complex input methods always give extra
|
|
561 guidance, but simple input methods give it only when you are not in
|
|
562 the minibuffer.
|
|
563
|
|
564 See also the variable `input-method-highlight-flag'."
|
|
565 :type '(choice (const t) (const nil) (const complex-only) (const default))
|
|
566 :group 'mule)
|
|
567
|
|
568 (defcustom input-method-highlight-flag t
|
|
569 "*If this flag is non-nil, input methods highlight partially-entered text.
|
|
570 For instance, while you are in the middle of a Quail input method sequence,
|
|
571 the text inserted so far is temporarily underlined.
|
|
572 The underlining goes away when you finish or abort the input method sequence.
|
|
573 See also the variable `input-method-verbose-flag'."
|
|
574 :type 'boolean
|
|
575 :group 'mule)
|
|
576
|
|
577 (defvar input-method-activate-hook nil
|
|
578 "Normal hook run just after an input method is activated.
|
|
579
|
|
580 The variable `current-input-method' keeps the input method name
|
|
581 just activated.")
|
|
582
|
|
583 (defvar input-method-inactivate-hook nil
|
|
584 "Normal hook run just after an input method is inactivated.
|
|
585
|
|
586 The variable `current-input-method' still keeps the input method name
|
|
587 just inactivated.")
|
|
588
|
|
589 (defvar input-method-after-insert-chunk-hook nil
|
|
590 "Normal hook run just after an input method insert some chunk of text.")
|
|
591
|
|
592 (defvar input-method-exit-on-first-char nil
|
|
593 "This flag controls a timing when an input method returns.
|
|
594 Usually, the input method does not return while there's a possibility
|
|
595 that it may find a different translation if a user types another key.
|
|
596 But, it this flag is non-nil, the input method returns as soon as
|
|
597 the current key sequence gets long enough to have some valid translation.")
|
|
598
|
|
599 (defvar input-method-use-echo-area nil
|
|
600 "This flag controls how an input method shows an intermediate key sequence.
|
|
601 Usually, the input method inserts the intermediate key sequence,
|
|
602 or candidate translations corresponding to the sequence,
|
|
603 at point in the current buffer.
|
|
604 But, if this flag is non-nil, it displays them in echo area instead.")
|
|
605
|
|
606 (defvar input-method-exit-on-invalid-key nil
|
442
|
607 "This flag controls the behavior of an input method on invalid key input.
|
428
|
608 Usually, when a user types a key which doesn't start any character
|
|
609 handled by the input method, the key is handled by turning off the
|
|
610 input method temporarily. After that key, the input method is re-enabled.
|
|
611 But, if this flag is non-nil, the input method is never back on.")
|
|
612
|
|
613
|
|
614 (defvar set-language-environment-hook nil
|
|
615 "Normal hook run after some language environment is set.
|
|
616
|
|
617 When you set some hook function here, that effect usually should not
|
|
618 be inherited to another language environment. So, you had better set
|
|
619 another function in `exit-language-environment-hook' (which see) to
|
|
620 cancel the effect.")
|
|
621
|
|
622 (defvar exit-language-environment-hook nil
|
|
623 "Normal hook run after exiting from some language environment.
|
|
624 When this hook is run, the variable `current-language-environment'
|
|
625 is still bound to the language environment being exited.
|
|
626
|
|
627 This hook is mainly used for canceling the effect of
|
|
628 `set-language-environment-hook' (which-see).")
|
|
629
|
771
|
630 ;; bogus FSF function setup-specified-language-support.
|
428
|
631
|
|
632 (defcustom current-language-environment "English"
|
|
633 "The last language environment specified with `set-language-environment'.
|
|
634 This variable should be set only with \\[customize], which is equivalent
|
|
635 to using the function `set-language-environment'."
|
|
636 :link '(custom-manual "(emacs)Language Environments")
|
|
637 :set (lambda (symbol value) (set-language-environment value))
|
|
638 :get (lambda (x)
|
|
639 (or (car-safe (assoc-ignore-case
|
|
640 (if (symbolp current-language-environment)
|
|
641 (symbol-name current-language-environment)
|
|
642 current-language-environment)
|
|
643 language-info-alist))
|
|
644 "English"))
|
|
645 :type (cons 'choice (mapcar (lambda (lang)
|
|
646 (list 'const (car lang)))
|
|
647 language-info-alist))
|
|
648 :initialize 'custom-initialize-default
|
|
649 :group 'mule
|
|
650 :type 'string)
|
|
651
|
|
652 (defun set-language-environment (language-name)
|
|
653 "Set up multi-lingual environment for using LANGUAGE-NAME.
|
771
|
654 This sets the coding system autodetection priority, the default buffer
|
|
655 coding system, the default input method, the system locale, and other
|
|
656 relevant language properties. LANGUAGE-NAME should be a string, the
|
|
657 name of a language environment. For example, \"Latin-1\" specifies
|
|
658 the language environment for the major languages of Western Europe."
|
428
|
659 (interactive (list (read-language-name
|
|
660 nil
|
|
661 "Set language environment (default, English): ")))
|
|
662 (if language-name
|
|
663 (if (symbolp language-name)
|
|
664 (setq language-name (symbol-name language-name)))
|
|
665 (setq language-name "English"))
|
|
666 (or (assoc-ignore-case language-name language-info-alist)
|
771
|
667 (error 'invalid-argument "Language environment not defined"
|
|
668 language-name))
|
428
|
669 (if current-language-environment
|
|
670 (let ((func (get-language-info current-language-environment
|
|
671 'exit-function)))
|
|
672 (run-hooks 'exit-language-environment-hook)
|
|
673 (if (fboundp func) (funcall func))))
|
771
|
674 (setq current-language-environment language-name)
|
428
|
675 (let ((default-eol-type (coding-system-eol-type
|
|
676 default-buffer-file-coding-system)))
|
771
|
677 (reset-coding-categories-to-default)
|
|
678 (set-locale-for-language-environment language-name)
|
|
679 (set-language-environment-coding-systems language-name default-eol-type))
|
|
680
|
|
681 (finish-set-language-environment language-name))
|
428
|
682
|
771
|
683 (defun finish-set-language-environment (language-name)
|
|
684 ;; Internal function. Only what's here is called at startup, once the
|
|
685 ;; first language environment is determined. The above stuff was already
|
|
686 ;; taken care of very early in the startup sequence, in a special
|
|
687 ;; fashion.
|
428
|
688 (let ((input-method (get-language-info language-name 'input-method)))
|
|
689 (when input-method
|
|
690 (setq default-input-method input-method)
|
|
691 (if input-method-history
|
|
692 (setq input-method-history
|
|
693 (cons input-method
|
|
694 (delete input-method input-method-history))))))
|
|
695 ;; (let ((nonascii (get-language-info language-name 'nonascii-translation))
|
|
696 ;; (dos-table
|
|
697 ;; (if (eq window-system 'pc)
|
|
698 ;; (intern
|
|
699 ;; (concat "cp" dos-codepage "-nonascii-translation-table")))))
|
|
700 ;; (cond
|
|
701 ;; ((char-table-p nonascii)
|
|
702 ;; (setq nonascii-translation-table nonascii))
|
|
703 ;; ((and (eq window-system 'pc) (boundp dos-table))
|
|
704 ;; ;; DOS terminals' default is to use a special non-ASCII translation
|
|
705 ;; ;; table as appropriate for the installed codepage.
|
|
706 ;; (setq nonascii-translation-table (symbol-value dos-table)))
|
|
707 ;; ((charsetp nonascii)
|
|
708 ;; (setq nonascii-insert-offset (- (make-char nonascii) 128)))))
|
|
709
|
|
710 ;; (setq charset-origin-alist
|
|
711 ;; (get-language-info language-name 'charset-origin-alist))
|
|
712
|
|
713 ;; Unibyte setups if necessary.
|
|
714 ;; (unless default-enable-multibyte-characters
|
|
715 ;; ;; Syntax and case table.
|
|
716 ;; (let ((syntax (get-language-info language-name 'unibyte-syntax)))
|
|
717 ;; (if syntax
|
|
718 ;; (let ((set-case-syntax-set-multibyte nil))
|
|
719 ;; (load syntax nil t))
|
|
720 ;; ;; No information for syntax and case. Reset to the defaults.
|
|
721 ;; (let ((syntax-table (standard-syntax-table))
|
|
722 ;; (case-table (standard-case-table))
|
|
723 ;; (ch (if (eq window-system 'pc) 128 160)))
|
|
724 ;; (while (< ch 256)
|
|
725 ;; (modify-syntax-entry ch " " syntax-table)
|
|
726 ;; (aset case-table ch ch)
|
|
727 ;; (setq ch (1+ ch)))
|
|
728 ;; (set-char-table-extra-slot case-table 0 nil)
|
|
729 ;; (set-char-table-extra-slot case-table 1 nil)
|
|
730 ;; (set-char-table-extra-slot case-table 2 nil))
|
|
731 ;; (set-standard-case-table (standard-case-table))
|
|
732 ;; (let ((list (buffer-list)))
|
|
733 ;; (while list
|
|
734 ;; (with-current-buffer (car list)
|
|
735 ;; (set-case-table (standard-case-table)))
|
|
736 ;; (setq list (cdr list))))))
|
|
737 ;; ;; Display table and coding system for terminal.
|
|
738 ;; (let ((coding (get-language-info language-name 'unibyte-display)))
|
|
739 ;; (if coding
|
|
740 ;; (standard-display-european-internal)
|
|
741 ;; (standard-display-default (if (eq window-system 'pc) 128 160) 255)
|
|
742 ;; (aset standard-display-table 146 nil))
|
|
743 ;; (or (eq window-system 'pc)
|
|
744 ;; (set-terminal-coding-system coding))))
|
|
745
|
|
746 (let ((required-features (get-language-info language-name 'features)))
|
|
747 (while required-features
|
|
748 (require (car required-features))
|
|
749 (setq required-features (cdr required-features))))
|
|
750 (let ((func (get-language-info language-name 'setup-function)))
|
|
751 (if (fboundp func)
|
|
752 (funcall func)))
|
952
|
753
|
|
754 ;; Fit the charsets preferences in unicode conversions for the
|
|
755 ;; language environment.
|
1285
|
756 (set-language-unicode-precedence-list
|
|
757 (get-language-info language-name 'charset))
|
952
|
758
|
428
|
759 (run-hooks 'set-language-environment-hook)
|
|
760 (force-mode-line-update t))
|
|
761
|
|
762 ;; (defun standard-display-european-internal ()
|
|
763 ;; ;; Actually set up direct output of non-ASCII characters.
|
|
764 ;; (standard-display-8bit (if (eq window-system 'pc) 128 160) 255)
|
|
765 ;; ;; Unibyte Emacs on MS-DOS wants to display all 8-bit characters with
|
|
766 ;; ;; the native font, and codes 160 and 146 stand for something very
|
|
767 ;; ;; different there.
|
|
768 ;; (or (and (eq window-system 'pc) (not default-enable-multibyte-characters))
|
|
769 ;; (progn
|
|
770 ;; ;; Make non-line-break space display as a plain space.
|
|
771 ;; ;; Most X fonts do the wrong thing for code 160.
|
|
772 ;; (aset standard-display-table 160 [32])
|
|
773 ;; ;; Most Windows programs send out apostrophe's as \222. Most X fonts
|
|
774 ;; ;; don't contain a character at that position. Map it to the ASCII
|
|
775 ;; ;; apostrophe.
|
|
776 ;; (aset standard-display-table 146 [39]))))
|
|
777
|
771
|
778 ;; bogus FSF function describe-specified-language-support.
|
428
|
779
|
|
780 (defun describe-language-environment (language-name)
|
|
781 "Describe how Emacs supports language environment LANGUAGE-NAME."
|
|
782 (interactive
|
|
783 (list (read-language-name
|
|
784 'documentation
|
|
785 "Describe language environment (default, current choice): ")))
|
|
786 (if (null language-name)
|
|
787 (setq language-name current-language-environment))
|
|
788 (if (or (null language-name)
|
|
789 (null (get-language-info language-name 'documentation)))
|
|
790 (error "No documentation for the specified language"))
|
|
791 (if (symbolp language-name)
|
|
792 (setq language-name (symbol-name language-name)))
|
|
793 (let ((doc (get-language-info language-name 'documentation)))
|
771
|
794 (flet ((princ-list (&rest args)
|
|
795 (while args (princ (car args)) (setq args (cdr args)))
|
|
796 (princ "\n")))
|
|
797 (with-output-to-temp-buffer "*Help*"
|
|
798 (princ-list language-name " language environment" "\n")
|
|
799 (if (stringp doc)
|
428
|
800 (progn
|
771
|
801 (princ-list doc)
|
|
802 (terpri)))
|
|
803 (let ((str (get-language-info language-name 'sample-text)))
|
|
804 (if (stringp str)
|
|
805 (progn
|
|
806 (princ "Sample text:\n")
|
|
807 (princ-list " " str)
|
|
808 (terpri))))
|
|
809 (let ((input-method (get-language-info language-name 'input-method))
|
|
810 (l (copy-sequence input-method-alist)))
|
|
811 (princ "Input methods")
|
|
812 (when input-method
|
|
813 (princ (format " (default, %s)" input-method))
|
|
814 (setq input-method (assoc input-method input-method-alist))
|
|
815 (setq l (cons input-method (delete input-method l))))
|
|
816 (princ ":\n")
|
428
|
817 (while l
|
771
|
818 (if (string= language-name (nth 1 (car l)))
|
|
819 (princ-list " " (car (car l))
|
|
820 (format " (`%s' in mode line)" (nth 3 (car l)))))
|
|
821 (setq l (cdr l))))
|
|
822 (terpri)
|
|
823 (princ "Character sets:\n")
|
|
824 (let ((l (get-language-info language-name 'charset)))
|
|
825 (if (null l)
|
|
826 (princ-list " nothing specific to " language-name)
|
|
827 (while l
|
|
828 (princ-list " " (car l) ": "
|
|
829 (charset-description (car l)))
|
|
830 (setq l (cdr l)))))
|
|
831 (terpri)
|
|
832 (princ "Coding systems:\n")
|
|
833 (let ((l (get-language-info language-name 'coding-system)))
|
|
834 (if (null l)
|
|
835 (princ-list " nothing specific to " language-name)
|
|
836 (while l
|
|
837 (princ ; (format " %s (`%c' in mode line):\n\t%s\n"
|
|
838 ;; In XEmacs, `coding-system-mnemonic' returns string.
|
|
839 (format " %s (`%s' in English, `%s' in mode line):\n\t%s\n"
|
|
840 (car l)
|
|
841 (coding-system-description (car l))
|
|
842 (coding-system-mnemonic (car l))
|
|
843 (or (coding-system-documentation (car l))
|
|
844 "Not documented.")) )
|
|
845 ;; (let ((aliases (coding-system-get (car l) 'alias-coding-systems)))
|
|
846 ;; (when aliases
|
|
847 ;; (princ "\t")
|
|
848 ;; (princ (cons 'alias: (cdr aliases)))
|
|
849 ;; (terpri)))
|
|
850 (setq l (cdr l)))))))))
|
428
|
851
|
|
852 ;;; Charset property
|
|
853
|
|
854 ;; (defsubst get-charset-property (charset propname)
|
|
855 ;; "Return the value of CHARSET's PROPNAME property.
|
|
856 ;; This is the last value stored with
|
|
857 ;; `(put-charset-property CHARSET PROPNAME VALUE)'."
|
|
858 ;; (plist-get (charset-plist charset) propname))
|
|
859
|
|
860 ;; (defsubst put-charset-property (charset propname value)
|
|
861 ;; "Store CHARSETS's PROPNAME property with value VALUE.
|
|
862 ;; It can be retrieved with `(get-charset-property CHARSET PROPNAME)'."
|
|
863 ;; (set-charset-plist charset
|
|
864 ;; (plist-put (charset-plist charset) propname value)))
|
|
865
|
|
866 (defvar char-code-property-table
|
|
867 (make-char-table 'generic)
|
|
868 "Char-table containing a property list of each character code.
|
|
869
|
|
870 See also the documentation of `get-char-code-property' and
|
|
871 `put-char-code-property'")
|
|
872 ;; (let ((plist (aref char-code-property-table char)))
|
|
873 (defun get-char-code-property (char propname)
|
|
874 "Return the value of CHAR's PROPNAME property in `char-code-property-table'."
|
|
875 (let ((plist (get-char-table char char-code-property-table)))
|
|
876 (if (listp plist)
|
|
877 (car (cdr (memq propname plist))))))
|
|
878
|
|
879 (defun put-char-code-property (char propname value)
|
|
880 "Store CHAR's PROPNAME property with VALUE in `char-code-property-table'.
|
|
881 It can be retrieved with `(get-char-code-property CHAR PROPNAME)'."
|
|
882 (let ((plist (get-char-table char char-code-property-table)))
|
|
883 (if plist
|
|
884 (let ((slot (memq propname plist)))
|
|
885 (if slot
|
|
886 (setcar (cdr slot) value)
|
|
887 (nconc plist (list propname value))))
|
|
888 (put-char-table char (list propname value) char-code-property-table)
|
|
889 )))
|
|
890
|
|
891
|
|
892 ;; Pretty description of encoded string
|
|
893
|
|
894 ;; Alist of ISO 2022 control code vs the corresponding mnemonic string.
|
|
895 ;; (defvar iso-2022-control-alist
|
|
896 ;; '((?\x1b . "ESC")
|
|
897 ;; (?\x0e . "SO")
|
|
898 ;; (?\x0f . "SI")
|
|
899 ;; (?\x8e . "SS2")
|
|
900 ;; (?\x8f . "SS3")
|
|
901 ;; (?\x9b . "CSI")))
|
|
902
|
|
903 ;; (defun encoded-string-description (str coding-system)
|
|
904 ;; "Return a pretty description of STR that is encoded by CODING-SYSTEM."
|
|
905 ;; (setq str (string-as-unibyte str))
|
|
906 ;; (let ((char (aref str 0))
|
|
907 ;; desc)
|
|
908 ;; (when (< char 128)
|
|
909 ;; (setq desc (or (cdr (assq char iso-2022-control-alist))
|
|
910 ;; (char-to-string char)))
|
|
911 ;; (let ((i 1)
|
|
912 ;; (len (length str)))
|
|
913 ;; (while (< i len)
|
|
914 ;; (setq char (aref str i))
|
|
915 ;; (if (>= char 128)
|
|
916 ;; (setq desc nil i len)
|
|
917 ;; (setq desc (concat desc " "
|
|
918 ;; (or (cdr (assq char iso-2022-control-alist))
|
|
919 ;; (char-to-string char)))
|
|
920 ;; i (1+ i))))))
|
|
921 ;; (or desc
|
|
922 ;; (mapconcat (function (lambda (x) (format "0x%02x" x))) str " "))))
|
|
923
|
|
924 ;; (defun encode-coding-char (char coding-system)
|
|
925 ;; "Encode CHAR by CODING-SYSTEM and return the resulting string.
|
|
926 ;; If CODING-SYSTEM can't safely encode CHAR, return nil."
|
|
927 ;; (if (cmpcharp char)
|
|
928 ;; (setq char (car (decompose-composite-char char 'list))))
|
|
929 ;; (let ((str1 (char-to-string char))
|
|
930 ;; (str2 (make-string 2 char))
|
|
931 ;; (safe-charsets (and coding-system
|
|
932 ;; (coding-system-get coding-system 'safe-charsets)))
|
|
933 ;; enc1 enc2 i1 i2)
|
|
934 ;; (when (or (eq safe-charsets t)
|
|
935 ;; (memq (char-charset char) safe-charsets))
|
|
936 ;; ;; We must find the encoded string of CHAR. But, just encoding
|
|
937 ;; ;; CHAR will put extra control sequences (usually to designate
|
440
|
938 ;; ;; ASCII charset) at the tail if type of CODING is ISO 2022.
|
428
|
939 ;; ;; To exclude such tailing bytes, we at first encode one-char
|
|
940 ;; ;; string and two-char string, then check how many bytes at the
|
|
941 ;; ;; tail of both encoded strings are the same.
|
|
942 ;;
|
|
943 ;; (setq enc1 (string-as-unibyte (encode-coding-string str1 coding-system))
|
|
944 ;; i1 (length enc1)
|
|
945 ;; enc2 (string-as-unibyte (encode-coding-string str2 coding-system))
|
|
946 ;; i2 (length enc2))
|
|
947 ;; (while (and (> i1 0) (= (aref enc1 (1- i1)) (aref enc2 (1- i2))))
|
|
948 ;; (setq i1 (1- i1) i2 (1- i2)))
|
|
949 ;;
|
|
950 ;; ;; Now (substring enc1 i1) and (substring enc2 i2) are the same,
|
|
951 ;; ;; and they are the extra control sequences at the tail to
|
|
952 ;; ;; exclude.
|
|
953 ;; (substring enc2 0 i2))))
|
|
954
|
771
|
955
|
|
956 ;; #### The following section is utter junk from mule-misc.el.
|
|
957 ;; I've deleted everything that's not referenced in mule-packages and
|
|
958 ;; not in FSF 20.6; there's no point in keeping old namespace-polluting
|
|
959 ;; Mule 2.3 crap around. --ben
|
|
960
|
|
961 (defvar self-insert-after-hook nil
|
|
962 "Hook to run when extended self insertion command exits. Should take
|
|
963 two arguments START and END corresponding to character position.")
|
|
964
|
|
965 (make-variable-buffer-local 'self-insert-after-hook)
|
|
966
|
|
967 (defun delete-text-in-column (from to)
|
|
968 "Delete the text between column FROM and TO (exclusive) of the current line.
|
|
969 Nil of FORM or TO means the current column.
|
|
970
|
|
971 If there's a character across the borders, the character is replaced
|
|
972 with the same width of spaces before deleting."
|
|
973 (save-excursion
|
|
974 (let (p1 p2)
|
|
975 (if from
|
|
976 (progn
|
|
977 (setq p1 (move-to-column from))
|
|
978 (if (> p1 from)
|
|
979 (progn
|
|
980 (delete-char -1)
|
|
981 (insert-char ? (- p1 (current-column)))
|
|
982 (forward-char (- from p1))))))
|
|
983 (setq p1 (point))
|
|
984 (if to
|
|
985 (progn
|
|
986 (setq p2 (move-to-column to))
|
|
987 (if (> p2 to)
|
|
988 (progn
|
|
989 (delete-char -1)
|
|
990 (insert-char ? (- p2 (current-column)))
|
|
991 (forward-char (- to p2))))))
|
|
992 (setq p2 (point))
|
|
993 (delete-region p1 p2))))
|
|
994
|
|
995 (defun cancel-undo-boundary ()
|
|
996 "Cancel undo boundary."
|
|
997 (if (and (consp buffer-undo-list)
|
|
998 (null (car buffer-undo-list)))
|
|
999 (setq buffer-undo-list (cdr buffer-undo-list))))
|
|
1000
|
|
1001 (defun define-egg-environment (env-sym doc-string enable-function)
|
|
1002 "Define a new language environment for egg, named by ENV-SYM.
|
|
1003 DOC-STRING should be a string describing the environment.
|
|
1004 ENABLE-FUNCTION should be a function of no arguments that will be called
|
|
1005 when the language environment is made current."
|
|
1006 (put env-sym 'egg-environ-doc-string doc-string)
|
|
1007 (put env-sym 'set-egg-environ enable-function))
|
|
1008
|
|
1009
|
|
1010 ;; Init code.
|
|
1011
|
|
1012 ;; auto-language-alist deleted. We have a more sophisticated system,
|
|
1013 ;; with the locales stored in the language data.
|
|
1014
|
801
|
1015 (defconst langenv-to-locale-hash (make-hash-table :test 'equal))
|
|
1016
|
771
|
1017 (defun get-language-environment-from-locale (locale)
|
|
1018 "Convert LOCALE into a language environment.
|
|
1019 LOCALE is a C library locale string, as returned by `current-locale'.
|
|
1020 Uses the `locale' property of the language environment."
|
801
|
1021 (or (gethash locale langenv-to-locale-hash)
|
|
1022 (let ((retval
|
|
1023 (block langenv
|
|
1024 (dolist (langcons language-info-alist)
|
|
1025 (let* ((lang (car langcons))
|
|
1026 (locs (get-language-info lang 'locale))
|
|
1027 (case-fold-search t))
|
|
1028 (dolist (loc (if (listp locs) locs (list locs)))
|
|
1029 (if (cond ((functionp loc)
|
|
1030 (funcall loc locale))
|
|
1031 ((stringp loc)
|
|
1032 (string-match
|
|
1033 (concat "^" loc "\\([^A-Za-z0-9]\\|$\\)")
|
|
1034 locale)))
|
|
1035 (return-from langenv lang))))))))
|
|
1036 (puthash locale retval langenv-to-locale-hash)
|
|
1037 retval)))
|
771
|
1038
|
|
1039 (defun mswindows-get-language-environment-from-locale (ms-locale)
|
|
1040 "Convert MS-LOCALE (an MS Windows locale) into a language environment.
|
|
1041 MS-LOCALE is in the format recognized by `set-mswindows-current-locale' --
|
|
1042 i.e. a language string or a cons (LANG . SUBLANG). Note: This is NOT the
|
|
1043 same as the C library locale format (see `set-current-locale')!
|
|
1044
|
|
1045 This looks up the `mswindows-locale' property of all language environments;
|
|
1046 if nothing matching is found, it looks for a language environment with the
|
|
1047 same name (modulo case differences) as the LANG part of the locale."
|
|
1048 (or (consp ms-locale) (setq ms-locale (cons ms-locale "DEFAULT")))
|
|
1049 (or (block langenv
|
|
1050 (dolist (langcons language-info-alist)
|
|
1051 (let* ((lang (car langcons))
|
|
1052 (mswlocs (get-language-info lang 'mswindows-locale))
|
|
1053 (mswlocs (if (and (consp mswlocs)
|
|
1054 (listp (cdr mswlocs)))
|
|
1055 mswlocs (list mswlocs))))
|
|
1056 (dolist (loc mswlocs)
|
|
1057 (or (consp loc) (setq loc (cons loc "DEFAULT")))
|
|
1058 (if (equalp loc ms-locale)
|
|
1059 (return-from langenv lang))))))
|
|
1060 (dolist (langcons language-info-alist)
|
|
1061 (let* ((lang (car langcons)))
|
|
1062 (if (equalp lang (car ms-locale))
|
|
1063 (return-from nil lang))))))
|
|
1064
|
|
1065 (defun get-native-coding-system-from-language-environment (langenv locale)
|
|
1066 "Return the native coding system appropriate for LANGENV.
|
|
1067 LANGENV is a string naming a language environment. May use the LOCALE
|
|
1068 \(which should be the C library LOCALE corresponding to LANGENV) to
|
|
1069 determine the correct coding system. (For example, in the Japanese language
|
|
1070 environment, there are multiple encodings in use: euc-jp, shift-jis, jis7,
|
|
1071 jis8, iso-2022-jp, etc. The LOCALE may tell which one is correct.)
|
|
1072
|
|
1073 Specifically: Under X, the returned value is determined from these two.
|
|
1074 Under MS Windows, the native coding system must be set from the default
|
|
1075 system locale and is not influenced by LOCALE. (In other words, a program
|
|
1076 can't set the text encoding used to communicate with the OS. To get around
|
|
1077 this, we use Unicode whenever available, i.e. on Windows NT always and on
|
1318
|
1078 Windows 9x whenever a Unicode version of a system call is available.)"
|
771
|
1079 (if (eq system-type 'windows-nt)
|
|
1080 ;; should not apply to Cygwin, I don't think
|
|
1081 'mswindows-multibyte-system-default
|
|
1082 (let ((ncod (get-language-info langenv 'native-coding-system)))
|
|
1083 (if (or (functionp ncod) (not (listp ncod)))
|
|
1084 (setq ncod (list ncod)))
|
|
1085 (let ((native
|
|
1086 (dolist (try-native ncod)
|
|
1087 (let ((result
|
|
1088 (if (functionp try-native)
|
|
1089 (funcall try-native locale)
|
|
1090 try-native)))
|
|
1091 (if result (return result))))))
|
|
1092 (or native (car (get-language-info langenv 'coding-system))
|
|
1093 'raw-text)))))
|
|
1094
|
|
1095 (defun get-coding-system-from-locale (locale)
|
|
1096 "Return the coding system corresponding to a locale string."
|
|
1097 (get-native-coding-system-from-language-environment
|
|
1098 (get-language-environment-from-locale locale) locale))
|
|
1099
|
|
1100 (defvar mswindows-langenv-to-locale-table (make-hash-table)
|
|
1101 "Table mapping language environments to associated MS Windows locales.
|
|
1102 There may be more than one MS Windows locale that maps to a given language
|
|
1103 environment, so once we've made the mapping, we record it here when we need
|
|
1104 to make the reverse mapping. For example, all MS Windows locales with
|
|
1105 language ENGLISH will map to language environment English, and when the
|
|
1106 user starts up in such a locale, switches to another language environment
|
|
1107 and then back to English, we want the same locale again.")
|
|
1108
|
|
1109 (defun set-locale-for-language-environment (langenv)
|
|
1110 "Sets the current system locale as appropriate for LANGENV.
|
|
1111 LANGENV is a language environment. The locale is determined by looking at
|
|
1112 the 'locale (or maybe 'mswindows-locale) property of LANGENV, and then
|
|
1113 setting it using `set-current-locale' and maybe also
|
|
1114 `mswindows-set-current-locale'. Also sets the LANG environment variable.
|
|
1115 Returns non-nil if successfully set the locale(s)."
|
|
1116 (flet ((mswindows-get-and-set-locale-from-langenv (langenv)
|
|
1117 ;; find the mswindows locale for the langenv, make it current,
|
|
1118 ;; and return it. first we check the langenv-to-locale table
|
|
1119 ;; ...
|
|
1120 (let ((ms-locale
|
|
1121 (gethash langenv mswindows-langenv-to-locale-table)))
|
|
1122 (if ms-locale (progn
|
778
|
1123 (declare-fboundp (mswindows-set-current-locale
|
|
1124 ms-locale))
|
771
|
1125 ms-locale)
|
|
1126 ;; ... if not, see if the langenv specifies any locale(s).
|
|
1127 ;; if not, construct one from the langenv name.
|
|
1128 (let* ((mslocs (get-language-info langenv 'mswindows-locale))
|
|
1129 (mslocs (or mslocs (cons (upcase langenv) "DEFAULT")))
|
|
1130 (mslocs (if (and (consp mslocs)
|
|
1131 (listp (cdr mslocs)))
|
|
1132 mslocs (list mslocs))))
|
|
1133 (dolist (msloc mslocs)
|
|
1134 ;; Sometimes a language with DEFAULT is different from
|
|
1135 ;; with SYS_DEFAULT, and on my system
|
|
1136 ;; (set-current-locale "chinese") is NOT the same as
|
|
1137 ;; (set-current-locale "chinese-default")! The latter
|
|
1138 ;; gives Taiwan (DEFAULT), the former PRC (SYS_DEFAULT).
|
|
1139 ;; In the interests of consistency, we always use DEFAULT.
|
|
1140 (or (consp msloc) (setq msloc (cons msloc "DEFAULT")))
|
|
1141 (when (condition-case nil
|
|
1142 (progn
|
778
|
1143 (declare-fboundp (mswindows-set-current-locale
|
|
1144 msloc))
|
771
|
1145 t)
|
|
1146 (error nil))
|
|
1147 (return msloc))))))))
|
|
1148 (if (eq system-type 'windows-nt)
|
|
1149 (let ((ms-locale (mswindows-get-and-set-locale-from-langenv langenv)))
|
|
1150 (when ms-locale
|
|
1151 ;; also need to set the clib locale.
|
|
1152 (or (set-current-locale
|
|
1153 ;; if the locale is '("DUTCH" . "DUTCH_BELGIAN"),
|
|
1154 ;; try "DUTCH-BELGIAN". (Case is insignificant;
|
|
1155 ;; "dutch-belgian" works just as well.) This type
|
|
1156 ;; of transformation should always work, and you
|
|
1157 ;; get back the canonicalized version -- in this
|
|
1158 ;; case "Dutch_Belgium.1252". Note the futility of
|
|
1159 ;; trying to construct "Belgium" directly from
|
|
1160 ;; "BELGIAN".
|
|
1161 ;;
|
|
1162 ;; BUT ... We actually have to be trickier.
|
|
1163 ;; ("SPANISH" . "SPANISH_DOMINICAN_REPUBLIC") needs
|
|
1164 ;; to end up as "SPANISH-DOMINICAN REPUBLIC"; any
|
|
1165 ;; other punctuation makes it fail (you either get
|
|
1166 ;; Spain for the country, or nil).
|
|
1167 ;;
|
|
1168 ;; assume it's DEFAULT or NEUTRAL (or something else
|
|
1169 ;; without the language in it?) and prepend the
|
|
1170 ;; language.
|
|
1171 (if (string-match "_" (cdr ms-locale))
|
|
1172 (replace-in-string
|
|
1173 (replace-match "-" nil nil (cdr ms-locale)) "_" " ")
|
|
1174 (format "%s-%s" (car ms-locale) (cdr ms-locale))))
|
|
1175 ;; ???? huh ???? if failure, just try the language
|
|
1176 ;; name.
|
|
1177 (set-current-locale (car ms-locale))))
|
|
1178 ;; also set LANG, for the benefit of Cygwin subprocesses.
|
|
1179 (let* ((cygloc (or (get-language-info langenv 'cygwin-locale)
|
|
1180 (get-language-info langenv 'locale)))
|
|
1181 (cygloc (if (listp cygloc) (car (last cygloc)) cygloc)))
|
|
1182 (if (and cygloc (stringp cygloc)) (setenv "LANG" cygloc)))
|
|
1183 (not (null ms-locale)))
|
|
1184
|
|
1185 ;; not MS Windows native.
|
|
1186
|
|
1187 ;; Cygwin is as usual an unholy mixture -- C library locales
|
|
1188 ;; that follow Unix conventions, but also MS Windows locales.
|
|
1189 ;; So set the MS Windows locale, and then try to find a Unix
|
|
1190 ;; locale.
|
|
1191 (when (eq system-type 'cygwin32)
|
|
1192 (mswindows-get-and-set-locale-from-langenv langenv))
|
|
1193 (let ((locs (get-language-info langenv 'locale)))
|
|
1194 (dolist (loc (if (listp locs) locs (list locs)))
|
|
1195 (let ((retval
|
|
1196 (cond ((functionp loc) (funcall loc nil))
|
|
1197 ((stringp loc) (set-current-locale loc))
|
|
1198 (t nil))))
|
|
1199 (when retval
|
|
1200 (setenv "LANG" retval)
|
|
1201 (return t))))))))
|
|
1202
|
|
1203 (defun set-language-environment-coding-systems (language-name
|
|
1204 &optional eol-type)
|
|
1205 "Do various coding system setups for language environment LANGUAGE-NAME.
|
|
1206 This function assumes that the locale for LANGUAGE-NAME has been set using
|
|
1207 `set-current-locale'.
|
|
1208
|
|
1209 The optional arg EOL-TYPE specifies the eol-type of the default value
|
|
1210 of buffer-file-coding-system set by this function."
|
|
1211
|
|
1212 ;; The following appeared as the third paragraph of the doc string for this
|
778
|
1213 ;; function, but it's not in FSF 21.1, and it's not true, since we call
|
771
|
1214 ;; reset-coding-categories-to-default before calling this function. ####
|
|
1215 ;; Should we rethink this?
|
|
1216
|
|
1217 ; Note that `coding-priority-list' is not reset first; thus changing language
|
|
1218 ; environment allows recognition of coding systems from previously set language
|
|
1219 ; environments. (This will not work if the desired coding systems are from the
|
|
1220 ; same category. E.g., starting with a Hebrew language environment, ISO 8859-8
|
|
1221 ; will be recognized. If you shift to Russian, ISO 8859-8 will be shadowed by
|
|
1222 ; ISO 8859-5, and cannot be automatically recognized without resetting the
|
|
1223 ; language environment to Hebrew. However, if you shift from Japanese to
|
|
1224 ; Russian, ISO-2022-JP will continue to be automatically recognized, since
|
|
1225 ; ISO-8859-5 and ISO-2022-JP are different coding categories.)"
|
|
1226
|
|
1227 (flet ((maybe-change-coding-system-with-eol (codesys eol-type)
|
|
1228 ;; if the EOL type specifies a specific type of ending,
|
|
1229 ;; then add that ending onto the given CODESYS; otherwise,
|
|
1230 ;; return CODESYS unchanged.
|
|
1231 (if (memq eol-type '(lf crlf cr unix dos mac))
|
|
1232 (coding-system-change-eol-conversion codesys eol-type)
|
|
1233 codesys)))
|
|
1234
|
|
1235 ;; initialize category mappings and priority list.
|
|
1236 (let* ((priority (get-language-info language-name 'coding-priority))
|
|
1237 (default-coding (car priority)))
|
|
1238 (if priority
|
|
1239 (let ((categories (mapcar 'coding-system-category priority))
|
|
1240 category checked-categories)
|
|
1241 (while priority
|
|
1242 (unless (memq (setq category (car categories)) checked-categories)
|
|
1243 (set-coding-category-system category (car priority))
|
|
1244 (setq checked-categories (cons category checked-categories)))
|
|
1245 (setq priority (cdr priority)
|
|
1246 categories (cdr categories)))
|
|
1247 (set-coding-priority-list (nreverse checked-categories))
|
|
1248 ))
|
|
1249
|
|
1250 ;; set the default buffer coding system from the first element of the
|
|
1251 ;; list in the `coding-priority' property, under Unix. Under Windows, it
|
|
1252 ;; should stay at `mswindows-multibyte', which will reference the current
|
|
1253 ;; code page. (#### Does it really make sense the set the Unix default
|
|
1254 ;; that way? NOTE also that it's not the same as the native coding
|
|
1255 ;; system for the locale, which is correct -- the form we choose for text
|
|
1256 ;; files should not necessarily have any relevant to whether we're in a
|
|
1257 ;; Shift-JIS, EUC-JP, JIS, or other Japanese locale.)
|
|
1258 (unless (memq system-type '(windows-nt cygwin32))
|
|
1259 (set-default-buffer-file-coding-system
|
|
1260 (maybe-change-coding-system-with-eol default-coding eol-type))))
|
|
1261 ;; (setq default-sendmail-coding-system default-coding)
|
|
1262
|
1318
|
1263 ;; set the native coding system and the default process-output system.
|
771
|
1264 (let ((native (get-native-coding-system-from-language-environment
|
|
1265 language-name (current-locale))))
|
1318
|
1266
|
771
|
1267 (condition-case nil
|
1318
|
1268 (define-coding-system-alias 'native
|
|
1269 (maybe-change-coding-system-with-eol native eol-type))
|
771
|
1270 (error
|
|
1271 (warn "Invalid native-coding-system %s in language environment %s"
|
|
1272 native language-name)))
|
1318
|
1273 (define-coding-system-alias 'file-name 'native)
|
3142
|
1274 ;; Set the default keyboard and terminal coding systems to the native
|
|
1275 ;; coding system of the language environment.
|
|
1276 ;;
|
|
1277 (setq keyboard-coding-system native
|
|
1278 terminal-coding-system native)
|
|
1279
|
|
1280 ;; And do the same for any TTYs.
|
|
1281 (dolist (con (console-list))
|
|
1282 (when (eq 'tty (device-type (car (console-device-list con))))
|
|
1283 ;; Calling set-input-mode at the same time would be a sane thing
|
|
1284 ;; to do here. I would prefer to default to accepting eight bit
|
|
1285 ;; input and not using the top bit for Meta.
|
|
1286 (set-console-tty-coding-system con native)))
|
|
1287
|
1318
|
1288 ;; process output should not have EOL conversion. under MS Windows
|
|
1289 ;; and Cygwin, this screws things up (`cmd' is fine with just LF and
|
|
1290 ;; `bash' chokes on CR-LF).
|
771
|
1291 (setq default-process-coding-system
|
1318
|
1292 (cons (car default-process-coding-system) native)))))
|
771
|
1293
|
|
1294 (defun init-locale-at-early-startup ()
|
|
1295 "Don't call this."
|
|
1296 ;; Called directly from the C code in intl.c, very early in the startup
|
|
1297 ;; sequence. Don't call this!!! The main purpose is to set things up
|
|
1298 ;; so that non-ASCII strings of all sorts (e.g. file names, command-line
|
|
1299 ;; arguments, environment variables) can be correctly processed during
|
|
1300 ;; the rest of the startup sequence. As a result, this will almost
|
|
1301 ;; certainly be the FIRST Lisp code called when a dumped XEmacs is run,
|
|
1302 ;; and it's called before ANY of the external environment is initialized.
|
|
1303 ;; Thus, it cannot interact at all with the outside world, make any
|
|
1304 ;; system calls, etc! (Except for `set-current-locale'.)
|
|
1305 ;;
|
|
1306 ;; NOTE: The following are the basic settings we have to deal with when
|
|
1307 ;; changing the language environment;
|
|
1308 ;;
|
|
1309 ;; -- current C library locale
|
|
1310 ;; -- under MS Windows, current MS Windows locale
|
|
1311 ;; -- LANG environment variable
|
|
1312 ;; -- native/file-name coding systems
|
|
1313 ;; -- subprocess write coding system (cdr of default-process-coding-system)
|
|
1314 ;; -- coding categories (for detection)
|
|
1315
|
|
1316 (let (langenv)
|
|
1317 ;; under ms windows (any):
|
|
1318 (if (memq system-type '(windows-nt cygwin32))
|
778
|
1319 (let ((userdef (declare-fboundp (mswindows-user-default-locale)))
|
|
1320 (sysdef (declare-fboundp (mswindows-system-default-locale))))
|
771
|
1321 ;; (1) current langenv comes from user-default locale.
|
|
1322 (setq langenv (mswindows-get-language-environment-from-locale
|
|
1323 userdef))
|
|
1324 ;; (2) init the langenv-to-locale table.
|
|
1325 (puthash (mswindows-get-language-environment-from-locale sysdef)
|
|
1326 sysdef mswindows-langenv-to-locale-table)
|
|
1327 ;; user-default second in langenv-to-locale table so it will
|
|
1328 ;; override the system-default if the two are different but both
|
|
1329 ;; map to the same language environment
|
|
1330 (puthash langenv userdef mswindows-langenv-to-locale-table)
|
|
1331 ;; (3) setup C lib locale, MS Windows locale, LANG environment
|
|
1332 ;; variable. Note that under Cygwin we are ignoring the
|
|
1333 ;; passed-in LANG environment variable for the moment -- it's
|
|
1334 ;; usually wrong anyway and just says "C". #### Perhaps we
|
|
1335 ;; should reconsider.
|
|
1336 (and langenv (set-locale-for-language-environment langenv))
|
|
1337 ;; (4) override current MS Windows locale with the user-default
|
|
1338 ;; locale. Always init the MS Windows locale from the
|
|
1339 ;; user-default locale even if the langenv doesn't correspond;
|
|
1340 ;; we might not be able to find a langenv for the user-default
|
|
1341 ;; locale but we should still use the right code page, etc.
|
778
|
1342 (declare-fboundp (mswindows-set-current-locale userdef)))
|
771
|
1343 ;; Unix:
|
3173
|
1344 (let (locstring)
|
|
1345 ;; Init the POSIX locale from the environment--this calls the C
|
|
1346 ;; library's setlocale(3).
|
|
1347 (set-current-locale "")
|
|
1348 ;; Can't let locstring be the result of (set-current-locale "")
|
|
1349 ;; because that can return a more detailed string than we know how
|
|
1350 ;; to handle.
|
|
1351 (setq locstring (current-locale)
|
|
1352 ;; assume C lib locale and LANG env var are set correctly.
|
|
1353 ;; use them to find the langenv.
|
|
1354 langenv
|
|
1355 (and locstring (get-language-environment-from-locale
|
|
1356 locstring)))))
|
771
|
1357 ;; All systems:
|
|
1358 (unless langenv (setq langenv "English"))
|
|
1359 (setq current-language-environment langenv)
|
|
1360 ;; Setup various coding systems and categories.
|
|
1361 (let ((default-eol-type (coding-system-eol-type
|
|
1362 default-buffer-file-coding-system)))
|
|
1363 (reset-language-environment)
|
|
1364 (set-language-environment-coding-systems langenv default-eol-type))))
|
|
1365
|
|
1366 (defun init-mule-at-startup ()
|
|
1367 "Initialize MULE environment at startup. Don't call this."
|
|
1368
|
2367
|
1369 (when (not load-unicode-tables-at-dump-time)
|
|
1370 (load-unicode-tables))
|
771
|
1371
|
2367
|
1372 ;; This is called (currently; might be moved earlier) from startup.el,
|
|
1373 ;; after the basic GUI systems have been initialized, and just before the
|
|
1374 ;; init file gets read in. It needs to finish up initializing the
|
|
1375 ;; current language environment. Very early in the startup procedure we
|
|
1376 ;; determined the default language environment from the locale, and
|
|
1377 ;; bootstrapped the native, file-name and process I/O coding systems.
|
|
1378 ;; Now we need to do it over `the right away'.
|
771
|
1379 (finish-set-language-environment current-language-environment)
|
|
1380
|
|
1381 ;; Load a (localizable) locale-specific init file, if it exists.
|
|
1382 ;; We now use the language environment name, NOT the locale,
|
|
1383 ;; whose name varies from system to system.
|
|
1384 (load (format "%s%s/locale-start"
|
|
1385 (locate-data-directory "start-files")
|
|
1386 current-language-environment)
|
|
1387 t t)
|
|
1388
|
|
1389 ;; #### the rest is junk that should be deleted.
|
|
1390
|
|
1391 (when current-language-environment
|
|
1392 ;; rman seems to be incompatible with encoded text
|
|
1393 (setq Manual-use-rosetta-man nil))
|
|
1394
|
|
1395 ;; Register available input methods by loading LEIM list file.
|
|
1396 (load "leim-list.el" 'noerror 'nomessage 'nosuffix)
|
|
1397 )
|
|
1398
|
|
1399 ;; Code deleted: init-mule-tm (Enable the tm package by default)
|
428
|
1400
|
|
1401 ;;; mule-cmds.el ends here
|