comparison lisp/international/mule-cmds.el @ 90861:4f7df84e666c

(toggle-enable-multibyte-characters, sort-coding-systems, search-unencodable-char): Doc fixes. (default-input-method, input-method-verbose-flag, input-method-highlight-flag): Remove * in defcustom's docstrings. (exit-language-environment-hook, set-default-coding-systems, coding-system-change-eol-conversion, prefer-coding-system, find-multibyte-characters, leim-list-entry-regexp, set-input-method, input-method-exit-on-first-char, princ-list, locale-language-names, locale-charset-language-names, define-char-code-property): Fix typos in docstrings.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 29 May 2007 00:14:53 +0000
parents dd7c098af727
children 996f89a629d7
comparison
equal deleted inserted replaced
90860:848729201b1c 90861:4f7df84e666c
1 ;;; mule-cmds.el --- commands for mulitilingual environment -*-coding: iso-2022-7bit -*- 1 ;;; mule-cmds.el --- commands for multilingual environment -*-coding: iso-2022-7bit -*-
2 2
3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 ;; 2006, 2007 Free Software Foundation, Inc. 4 ;; 2006, 2007 Free Software Foundation, Inc.
5 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 5 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
6 ;; 2005, 2006, 2007 6 ;; 2005, 2006, 2007
204 "\\)\\s-+\\)?" 204 "\\)\\s-+\\)?"
205 ;; Note starting with word-syntax character: 205 ;; Note starting with word-syntax character:
206 "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'"))) 206 "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'")))
207 207
208 (defun coding-system-change-eol-conversion (coding-system eol-type) 208 (defun coding-system-change-eol-conversion (coding-system eol-type)
209 "Return a coding system which differs from CODING-SYSTEM in eol conversion. 209 "Return a coding system which differs from CODING-SYSTEM in EOL conversion.
210 The returned coding system converts end-of-line by EOL-TYPE 210 The returned coding system converts end-of-line by EOL-TYPE
211 but text as the same way as CODING-SYSTEM. 211 but text as the same way as CODING-SYSTEM.
212 EOL-TYPE should be `unix', `dos', `mac', or nil. 212 EOL-TYPE should be `unix', `dos', `mac', or nil.
213 If EOL-TYPE is nil, the returned coding system detects 213 If EOL-TYPE is nil, the returned coding system detects
214 how end-of-line is formatted automatically while decoding. 214 how end-of-line is formatted automatically while decoding.
254 Note that this command does not convert the byte contents of 254 Note that this command does not convert the byte contents of
255 the buffer; it only changes the way those bytes are interpreted. 255 the buffer; it only changes the way those bytes are interpreted.
256 In general, therefore, this command *changes* the sequence of 256 In general, therefore, this command *changes* the sequence of
257 characters that the current buffer contains. 257 characters that the current buffer contains.
258 258
259 We suggest you avoid using use this command unless you know what you 259 We suggest you avoid using this command unless you know what you are
260 are doing. If you use it by mistake, and the buffer is now displayed 260 doing. If you use it by mistake, and the buffer is now displayed
261 wrong, use this command again to toggle back to the right mode." 261 wrong, use this command again to toggle back to the right mode."
262 (interactive "P") 262 (interactive "P")
263 (let ((new-flag 263 (let ((new-flag
264 (if (null arg) (null enable-multibyte-characters) 264 (if (null arg) (null enable-multibyte-characters)
265 (> (prefix-numeric-value arg) 0)))) 265 (> (prefix-numeric-value arg) 0))))
328 This sets the following coding systems: 328 This sets the following coding systems:
329 o coding system of a newly created buffer 329 o coding system of a newly created buffer
330 o default coding system for subprocess I/O 330 o default coding system for subprocess I/O
331 This also sets the following values: 331 This also sets the following values:
332 o default value used as `file-name-coding-system' for converting file names 332 o default value used as `file-name-coding-system' for converting file names
333 if CODING-SYSTEM is ASCII-compatible. 333 if CODING-SYSTEM is ASCII-compatible
334 o default value for the command `set-terminal-coding-system' (not on MSDOS) 334 o default value for the command `set-terminal-coding-system' (not on MSDOS)
335 o default value for the command `set-keyboard-coding-system' 335 o default value for the command `set-keyboard-coding-system'
336 if CODING-SYSTEM is ASCII-compatible.." 336 if CODING-SYSTEM is ASCII-compatible"
337 (check-coding-system coding-system) 337 (check-coding-system coding-system)
338 (setq-default buffer-file-coding-system coding-system) 338 (setq-default buffer-file-coding-system coding-system)
339 (if (fboundp 'ucs-set-table-for-input) 339 (if (fboundp 'ucs-set-table-for-input)
340 (dolist (buffer (buffer-list)) 340 (dolist (buffer (buffer-list))
341 (or (local-variable-p 'buffer-file-coding-system buffer) 341 (or (local-variable-p 'buffer-file-coding-system buffer)
371 "Add CODING-SYSTEM at the front of the priority list for automatic detection. 371 "Add CODING-SYSTEM at the front of the priority list for automatic detection.
372 This also sets the following coding systems: 372 This also sets the following coding systems:
373 o coding system of a newly created buffer 373 o coding system of a newly created buffer
374 o default coding system for subprocess I/O 374 o default coding system for subprocess I/O
375 This also sets the following values: 375 This also sets the following values:
376 o default value used as `file-name-coding-system' for converting file names. 376 o default value used as `file-name-coding-system' for converting file names
377 o default value for the command `set-terminal-coding-system' (not on MSDOS) 377 o default value for the command `set-terminal-coding-system' (not on MSDOS)
378 o default value for the command `set-keyboard-coding-system' 378 o default value for the command `set-keyboard-coding-system'
379 379
380 If CODING-SYSTEM specifies a certain type of EOL conversion, the coding 380 If CODING-SYSTEM specifies a certain type of EOL conversion, the coding
381 systems set by this function will use that type of EOL conversion. 381 systems set by this function will use that type of EOL conversion.
413 413
414 The function `sort-coding-systems' use it.") 414 The function `sort-coding-systems' use it.")
415 415
416 (defun sort-coding-systems (codings) 416 (defun sort-coding-systems (codings)
417 "Sort coding system list CODINGS by a priority of each coding system. 417 "Sort coding system list CODINGS by a priority of each coding system.
418 Returns the sorted list. CODINGS is modified by side effects. 418 Return the sorted list. CODINGS is modified by side effects.
419 419
420 If a coding system is most preferred, it has the highest priority. 420 If a coding system is most preferred, it has the highest priority.
421 Otherwise, a coding system corresponds to some MIME charset has higher 421 Otherwise, coding systems that correspond to MIME charsets have
422 priorities. Among them, a coding system included in `coding-system' 422 higher priorities. Among them, a coding system included in the
423 key of the current language environment has higher priorities. See 423 `coding-system' key of the current language environment has higher
424 also the documentation of `language-info-alist'. 424 priority. See also the documentation of `language-info-alist'.
425 425
426 If the variable `sort-coding-systems-predicate' (which see) is 426 If the variable `sort-coding-systems-predicate' (which see) is
427 non-nil, it is used to sort CODINGS in the different way than above." 427 non-nil, it is used to sort CODINGS instead."
428 (if sort-coding-systems-predicate 428 (if sort-coding-systems-predicate
429 (sort codings sort-coding-systems-predicate) 429 (sort codings sort-coding-systems-predicate)
430 (let* ((from-priority (coding-system-priority-list)) 430 (let* ((from-priority (coding-system-priority-list))
431 (most-preferred (car from-priority)) 431 (most-preferred (car from-priority))
432 (lang-preferred (get-language-info current-language-environment 432 (lang-preferred (get-language-info current-language-environment
554 where 554 where
555 CHARSET is a character set, 555 CHARSET is a character set,
556 COUNT is a number of characters, 556 COUNT is a number of characters,
557 CHARs are the characters found from the character set. 557 CHARs are the characters found from the character set.
558 Optional 3rd arg MAXCOUNT limits how many CHARs are put in the above list. 558 Optional 3rd arg MAXCOUNT limits how many CHARs are put in the above list.
559 Optional 4th arg EXCLUDE is a list of character sets to be ignored." 559 Optional 4th arg EXCLUDES is a list of character sets to be ignored."
560 (let ((chars nil) 560 (let ((chars nil)
561 charset char) 561 charset char)
562 (if (stringp from) 562 (if (stringp from)
563 (if (multibyte-string-p from) 563 (if (multibyte-string-p from)
564 (let ((idx 0)) 564 (let ((idx 0))
596 "Search forward from point for a character that is not encodable. 596 "Search forward from point for a character that is not encodable.
597 It asks which coding system to check. 597 It asks which coding system to check.
598 If such a character is found, set point after that character. 598 If such a character is found, set point after that character.
599 Otherwise, don't move point. 599 Otherwise, don't move point.
600 600
601 When called from a program, the value is a position of the found character, 601 When called from a program, the value is the position of the unencodable
602 or nil if all characters are encodable." 602 character found, or nil if all characters are encodable."
603 (interactive 603 (interactive
604 (list (let ((default (or buffer-file-coding-system 'us-ascii))) 604 (list (let ((default (or buffer-file-coding-system 'us-ascii)))
605 (read-coding-system 605 (read-coding-system
606 (format "Coding-system (default %s): " default) 606 (format "Coding-system (default %s): " default)
607 default)))) 607 default))))
1259 leim-list-file-name) 1259 leim-list-file-name)
1260 "Header to be inserted in LEIM list file.") 1260 "Header to be inserted in LEIM list file.")
1261 1261
1262 (defvar leim-list-entry-regexp "^(register-input-method" 1262 (defvar leim-list-entry-regexp "^(register-input-method"
1263 "Regexp matching head of each entry in LEIM list file. 1263 "Regexp matching head of each entry in LEIM list file.
1264 See also the variable `leim-list-header'") 1264 See also the variable `leim-list-header'.")
1265 1265
1266 (defvar update-leim-list-functions 1266 (defvar update-leim-list-functions
1267 '(quail-update-leim-list-file) 1267 '(quail-update-leim-list-file)
1268 "List of functions to call to update LEIM list file. 1268 "List of functions to call to update LEIM list file.
1269 Each function is called with one arg, LEIM directory name.") 1269 Each function is called with one arg, LEIM directory name.")
1285 "Title string of the current input method shown in mode line.") 1285 "Title string of the current input method shown in mode line.")
1286 (make-variable-buffer-local 'current-input-method-title) 1286 (make-variable-buffer-local 'current-input-method-title)
1287 (put 'current-input-method-title 'permanent-local t) 1287 (put 'current-input-method-title 'permanent-local t)
1288 1288
1289 (defcustom default-input-method nil 1289 (defcustom default-input-method nil
1290 "*Default input method for multilingual text (a string). 1290 "Default input method for multilingual text (a string).
1291 This is the input method activated automatically by the command 1291 This is the input method activated automatically by the command
1292 `toggle-input-method' (\\[toggle-input-method])." 1292 `toggle-input-method' (\\[toggle-input-method])."
1293 :link '(custom-manual "(emacs)Input Methods") 1293 :link '(custom-manual "(emacs)Input Methods")
1294 :group 'mule 1294 :group 'mule
1295 :type '(choice (const nil) (string 1295 :type '(choice (const nil) (string
1443 time you invoke \\[toggle-input-method]. 1443 time you invoke \\[toggle-input-method].
1444 When called interactively, the optional arg INTERACTIVE is non-nil, 1444 When called interactively, the optional arg INTERACTIVE is non-nil,
1445 which marks the variable `default-input-method' as set for Custom buffers. 1445 which marks the variable `default-input-method' as set for Custom buffers.
1446 1446
1447 To deactivate the input method interactively, use \\[toggle-input-method]. 1447 To deactivate the input method interactively, use \\[toggle-input-method].
1448 To deactivate it programmatically, use \\[inactivate-input-method]." 1448 To deactivate it programmatically, use `inactivate-input-method'."
1449 (interactive 1449 (interactive
1450 (let* ((default (or (car input-method-history) default-input-method))) 1450 (let* ((default (or (car input-method-history) default-input-method)))
1451 (list (read-input-method-name 1451 (list (read-input-method-name
1452 (if default "Select input method (default %s): " "Select input method: ") 1452 (if default "Select input method (default %s): " "Select input method: ")
1453 default t) 1453 default t)
1564 1564
1565 ;; Variables to control behavior of input methods. All input methods 1565 ;; Variables to control behavior of input methods. All input methods
1566 ;; should react to these variables. 1566 ;; should react to these variables.
1567 1567
1568 (defcustom input-method-verbose-flag 'default 1568 (defcustom input-method-verbose-flag 'default
1569 "*A flag to control extra guidance given by input methods. 1569 "A flag to control extra guidance given by input methods.
1570 The value should be nil, t, `complex-only', or `default'. 1570 The value should be nil, t, `complex-only', or `default'.
1571 1571
1572 The extra guidance is done by showing list of available keys in echo 1572 The extra guidance is done by showing list of available keys in echo
1573 area. When you use the input method in the minibuffer, the guidance 1573 area. When you use the input method in the minibuffer, the guidance
1574 is shown at the bottom short window (split from the existing window). 1574 is shown at the bottom short window (split from the existing window).
1587 :type '(choice (const :tag "Always" t) (const :tag "Never" nil) 1587 :type '(choice (const :tag "Always" t) (const :tag "Never" nil)
1588 (const complex-only) (const default)) 1588 (const complex-only) (const default))
1589 :group 'mule) 1589 :group 'mule)
1590 1590
1591 (defcustom input-method-highlight-flag t 1591 (defcustom input-method-highlight-flag t
1592 "*If this flag is non-nil, input methods highlight partially-entered text. 1592 "If this flag is non-nil, input methods highlight partially-entered text.
1593 For instance, while you are in the middle of a Quail input method sequence, 1593 For instance, while you are in the middle of a Quail input method sequence,
1594 the text inserted so far is temporarily underlined. 1594 the text inserted so far is temporarily underlined.
1595 The underlining goes away when you finish or abort the input method sequence. 1595 The underlining goes away when you finish or abort the input method sequence.
1596 See also the variable `input-method-verbose-flag'." 1596 See also the variable `input-method-verbose-flag'."
1597 :type 'boolean 1597 :type 'boolean
1620 1620
1621 (defvar input-method-exit-on-first-char nil 1621 (defvar input-method-exit-on-first-char nil
1622 "This flag controls when an input method returns. 1622 "This flag controls when an input method returns.
1623 Usually, the input method does not return while there's a possibility 1623 Usually, the input method does not return while there's a possibility
1624 that it may find a different translation if a user types another key. 1624 that it may find a different translation if a user types another key.
1625 But, it this flag is non-nil, the input method returns as soon as 1625 But, if this flag is non-nil, the input method returns as soon as
1626 the current key sequence gets long enough to have some valid translation.") 1626 the current key sequence gets long enough to have some valid translation.")
1627 1627
1628 (defcustom input-method-use-echo-area nil 1628 (defcustom input-method-use-echo-area nil
1629 "This flag controls how an input method shows an intermediate key sequence. 1629 "This flag controls how an input method shows an intermediate key sequence.
1630 Usually, the input method inserts the intermediate key sequence, 1630 Usually, the input method inserts the intermediate key sequence,
1656 "Normal hook run after exiting from some language environment. 1656 "Normal hook run after exiting from some language environment.
1657 When this hook is run, the variable `current-language-environment' 1657 When this hook is run, the variable `current-language-environment'
1658 is still bound to the language environment being exited. 1658 is still bound to the language environment being exited.
1659 1659
1660 This hook is mainly used for canceling the effect of 1660 This hook is mainly used for canceling the effect of
1661 `set-language-environment-hook' (which-see)." 1661 `set-language-environment-hook' (which see)."
1662 :type 'hook 1662 :type 'hook
1663 :group 'mule) 1663 :group 'mule)
1664 1664
1665 (put 'setup-specified-language-environment 'apropos-inhibit t) 1665 (put 'setup-specified-language-environment 'apropos-inhibit t)
1666 1666
1966 (defun set-language-environment-unibyte (language-name) 1966 (defun set-language-environment-unibyte (language-name)
1967 "Do various unibyte-mode setups for language environment LANGUAGE-NAME." 1967 "Do various unibyte-mode setups for language environment LANGUAGE-NAME."
1968 (set-display-table-and-terminal-coding-system language-name)) 1968 (set-display-table-and-terminal-coding-system language-name))
1969 1969
1970 (defsubst princ-list (&rest args) 1970 (defsubst princ-list (&rest args)
1971 "Print all arguments with `princ', then print \"\n\"." 1971 "Print all arguments with `princ', then print \"\\n\"."
1972 (while args (princ (car args)) (setq args (cdr args))) 1972 (while args (princ (car args)) (setq args (cdr args)))
1973 (princ "\n")) 1973 (princ "\n"))
1974 1974
1975 (put 'describe-specified-language-support 'apropos-inhibit t) 1975 (put 'describe-specified-language-support 'apropos-inhibit t)
1976 1976
2297 ("div" . "UTF-8") ; MS Windows Divehi (Maldives) 2297 ("div" . "UTF-8") ; MS Windows Divehi (Maldives)
2298 ("wee" . "Latin-2") ; MS Windows Lower Sorbian 2298 ("wee" . "Latin-2") ; MS Windows Lower Sorbian
2299 ("wen" . "Latin-2") ; MS Windows Upper Sorbian 2299 ("wen" . "Latin-2") ; MS Windows Upper Sorbian
2300 )) 2300 ))
2301 "Alist of locale regexps vs the corresponding languages and coding systems. 2301 "Alist of locale regexps vs the corresponding languages and coding systems.
2302 Each element has these form: 2302 Each element has this form:
2303 \(LOCALE-REGEXP LANG-ENV CODING-SYSTEM) 2303 \(LOCALE-REGEXP LANG-ENV CODING-SYSTEM)
2304 The first element whose LOCALE-REGEXP matches the start of a 2304 The first element whose LOCALE-REGEXP matches the start of a
2305 downcased locale specifies the LANG-ENV \(language environtment) 2305 downcased locale specifies the LANG-ENV \(language environment)
2306 and CODING-SYSTEM corresponding to that locale. If there is no 2306 and CODING-SYSTEM corresponding to that locale. If there is no
2307 appropriate language environment, the element may have this form: 2307 appropriate language environment, the element may have this form:
2308 \(LOCALE-REGEXP . LANG-ENV) 2308 \(LOCALE-REGEXP . LANG-ENV)
2309 In this case, LANG-ENV is one of generic language environments for an 2309 In this case, LANG-ENV is one of generic language environments for an
2310 specific encoding such as \"Latin-1\" and \"UTF-8\".") 2310 specific encoding such as \"Latin-1\" and \"UTF-8\".")
2324 (".*@euro\\>" . "Latin-9"))) 2324 (".*@euro\\>" . "Latin-9")))
2325 "List of pairs of locale regexps and charset language names. 2325 "List of pairs of locale regexps and charset language names.
2326 The first element whose locale regexp matches the start of a downcased locale 2326 The first element whose locale regexp matches the start of a downcased locale
2327 specifies the language name whose charset corresponds to that locale. 2327 specifies the language name whose charset corresponds to that locale.
2328 This language name is used if the locale is not listed in 2328 This language name is used if the locale is not listed in
2329 `locale-language-names'") 2329 `locale-language-names'.")
2330 2330
2331 (defconst locale-preferred-coding-systems 2331 (defconst locale-preferred-coding-systems
2332 (purecopy 2332 (purecopy
2333 '((".*8859[-_]?1\\>" . iso-8859-1) 2333 '((".*8859[-_]?1\\>" . iso-8859-1)
2334 (".*8859[-_]?2\\>" . iso-8859-2) 2334 (".*8859[-_]?2\\>" . iso-8859-2)
2645 "Define NAME as a character code property given by TABLE. 2645 "Define NAME as a character code property given by TABLE.
2646 TABLE is a char-table of purpose `char-code-property-table' with 2646 TABLE is a char-table of purpose `char-code-property-table' with
2647 these extra slots: 2647 these extra slots:
2648 1st: NAME. 2648 1st: NAME.
2649 2nd: Function to call to get a property value of a character. 2649 2nd: Function to call to get a property value of a character.
2650 It is called with three arugments CHAR, VAL, and TABLE, where 2650 It is called with three arguments CHAR, VAL, and TABLE, where
2651 CHAR is a character, VAL is the value of (aref TABLE CHAR). 2651 CHAR is a character, VAL is the value of (aref TABLE CHAR).
2652 3rd: Function to call to put a property value of a character. 2652 3rd: Function to call to put a property value of a character.
2653 It is called with the same arguments as above. 2653 It is called with the same arguments as above.
2654 4th: Function to call to get a description string of a property value. 2654 4th: Function to call to get a description string of a property value.
2655 It is called with one argument VALUE, a property value. 2655 It is called with one argument VALUE, a property value.