diff options
| author | Juanma Barranquero | 2008-11-18 01:35:25 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2008-11-18 01:35:25 +0000 |
| commit | d0d8885d3f97b134a7fc532ad864352fccad26e3 (patch) | |
| tree | 335b20f5c3552d122973ad795b39e50187a3a56a | |
| parent | 22854006f0135c511c54c1fa1300f9e18a39964a (diff) | |
| download | emacs-d0d8885d3f97b134a7fc532ad864352fccad26e3.tar.gz emacs-d0d8885d3f97b134a7fc532ad864352fccad26e3.zip | |
* international/mule-cmds.el (update-leim-list-file): Simplify.
(prefer-coding-system, find-coding-systems-for-charsets):
Fix docstring typos.
(select-safe-coding-system, input-method-exit-on-first-char)
(language-info-alist, language-info-custom-alist): Reflow docstrings.
(toggle-input-method, read-multilingual-string): Doc fixes.
Reflow docstrings.
(locale-name-match, sort-coding-systems, find-multibyte-characters)
(read-char-by-name): Use `string-match-p'.
(get-char-code-property, put-char-code-property)
(char-code-property-description): Be silent while loading uni-* files.
(ucs-names): Use `dotimes-with-progress-reporter', because loading
the Unicode character names is *slow*.
| -rw-r--r-- | lisp/ChangeLog | 19 | ||||
| -rw-r--r-- | lisp/international/mule-cmds.el | 109 |
2 files changed, 68 insertions, 60 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index deb8a42df7f..4010ba0e9f7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,9 +1,24 @@ | |||
| 1 | 2008-11-18 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * international/mule-cmds.el (update-leim-list-file): Simplify. | ||
| 4 | (prefer-coding-system, find-coding-systems-for-charsets): | ||
| 5 | Fix docstring typos. | ||
| 6 | (select-safe-coding-system, input-method-exit-on-first-char) | ||
| 7 | (language-info-alist, language-info-custom-alist): Reflow docstrings. | ||
| 8 | (toggle-input-method, read-multilingual-string): Doc fixes. | ||
| 9 | Reflow docstrings. | ||
| 10 | (locale-name-match, sort-coding-systems, find-multibyte-characters) | ||
| 11 | (read-char-by-name): Use `string-match-p'. | ||
| 12 | (get-char-code-property, put-char-code-property) | ||
| 13 | (char-code-property-description): Be silent while loading uni-* files. | ||
| 14 | (ucs-names): Use `dotimes-with-progress-reporter', because loading | ||
| 15 | the Unicode character names is *slow*. | ||
| 16 | |||
| 1 | 2008-11-17 Chong Yidong <cyd@stupidchicken.com> | 17 | 2008-11-17 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 18 | ||
| 3 | * wid-edit.el (widget-image-insert): Don't add a mouse-face. | 19 | * wid-edit.el (widget-image-insert): Don't add a mouse-face. |
| 4 | 20 | ||
| 5 | * cus-edit.el (custom-group-value-create): Don't insert docstring | 21 | * cus-edit.el (custom-group-value-create): Don't insert docstring twice. |
| 6 | twice. | ||
| 7 | 22 | ||
| 8 | 2008-11-17 Juanma Barranquero <lekktu@gmail.com> | 23 | 2008-11-17 Juanma Barranquero <lekktu@gmail.com> |
| 9 | 24 | ||
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index c78efc73c70..a367e6133ef 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -381,8 +381,8 @@ for MS-DOS terminal, because DOS terminals only support a single coding | |||
| 381 | system, and Emacs automatically sets the default to that coding system at | 381 | system, and Emacs automatically sets the default to that coding system at |
| 382 | startup. | 382 | startup. |
| 383 | 383 | ||
| 384 | A coding system that requires automatic detection of text | 384 | A coding system that requires automatic detection of text+encoding |
| 385 | +encoding (e.g. undecided, unix) can't be preferred.." | 385 | \(e.g. undecided, unix) can't be preferred." |
| 386 | (interactive "zPrefer coding system: ") | 386 | (interactive "zPrefer coding system: ") |
| 387 | (if (not (and coding-system (coding-system-p coding-system))) | 387 | (if (not (and coding-system (coding-system-p coding-system))) |
| 388 | (error "Invalid coding system `%s'" coding-system)) | 388 | (error "Invalid coding system `%s'" coding-system)) |
| @@ -448,18 +448,18 @@ non-nil, it is used to sort CODINGS instead." | |||
| 448 | ;; Lower utf-16 priority so that we | 448 | ;; Lower utf-16 priority so that we |
| 449 | ;; normally prefer utf-8 to it, and put | 449 | ;; normally prefer utf-8 to it, and put |
| 450 | ;; x-ctext below that. | 450 | ;; x-ctext below that. |
| 451 | (cond ((string-match "utf-16" | 451 | (cond ((string-match-p "utf-16" |
| 452 | (symbol-name mime)) | 452 | (symbol-name mime)) |
| 453 | 2) | 453 | 2) |
| 454 | ((string-match "^x-" (symbol-name mime)) | 454 | ((string-match-p "^x-" (symbol-name mime)) |
| 455 | 1) | 455 | 1) |
| 456 | (t 3)) | 456 | (t 3)) |
| 457 | 0)) | 457 | 0)) |
| 458 | 5) | 458 | 5) |
| 459 | (lsh (if (memq base lang-preferred) 1 0) 4) | 459 | (lsh (if (memq base lang-preferred) 1 0) 4) |
| 460 | (lsh (if (memq base from-priority) 1 0) 3) | 460 | (lsh (if (memq base from-priority) 1 0) 3) |
| 461 | (lsh (if (string-match "-with-esc\\'" | 461 | (lsh (if (string-match-p "-with-esc\\'" |
| 462 | (symbol-name base)) | 462 | (symbol-name base)) |
| 463 | 0 1) 2) | 463 | 0 1) 2) |
| 464 | (if (eq (coding-system-type base) 'iso-2022) | 464 | (if (eq (coding-system-type base) 'iso-2022) |
| 465 | (let ((category (coding-system-category base))) | 465 | (let ((category (coding-system-category base))) |
| @@ -512,7 +512,7 @@ CHARSETS is a list of character sets. | |||
| 512 | 512 | ||
| 513 | This only finds coding systems of type `charset', whose | 513 | This only finds coding systems of type `charset', whose |
| 514 | `:charset-list' property includes all of CHARSETS (plus `ascii' for | 514 | `:charset-list' property includes all of CHARSETS (plus `ascii' for |
| 515 | ascii-compatible coding systems). It was used in older versions of | 515 | ASCII-compatible coding systems). It was used in older versions of |
| 516 | Emacs, but is unlikely to be what you really want now." | 516 | Emacs, but is unlikely to be what you really want now." |
| 517 | ;; Deal with aliases. | 517 | ;; Deal with aliases. |
| 518 | (setq charsets (mapcar (lambda (c) | 518 | (setq charsets (mapcar (lambda (c) |
| @@ -558,7 +558,7 @@ Optional 4th arg EXCLUDES is a list of character sets to be ignored." | |||
| 558 | (if (stringp from) | 558 | (if (stringp from) |
| 559 | (if (multibyte-string-p from) | 559 | (if (multibyte-string-p from) |
| 560 | (let ((idx 0)) | 560 | (let ((idx 0)) |
| 561 | (while (setq idx (string-match "[^\000-\177]" from idx)) | 561 | (while (setq idx (string-match-p "[^\000-\177]" from idx)) |
| 562 | (setq char (aref from idx) | 562 | (setq char (aref from idx) |
| 563 | charset (char-charset char)) | 563 | charset (char-charset char)) |
| 564 | (unless (memq charset excludes) | 564 | (unless (memq charset excludes) |
| @@ -802,13 +802,12 @@ The candidates of coding systems which can safely encode a text | |||
| 802 | between FROM and TO are shown in a popup window. Among them, the most | 802 | between FROM and TO are shown in a popup window. Among them, the most |
| 803 | proper one is suggested as the default. | 803 | proper one is suggested as the default. |
| 804 | 804 | ||
| 805 | The list of `buffer-file-coding-system' of the current buffer, | 805 | The list of `buffer-file-coding-system' of the current buffer, the |
| 806 | the `default-buffer-file-coding-system', and the | 806 | `default-buffer-file-coding-system', and the most preferred coding |
| 807 | most preferred coding system (if it corresponds to a MIME charset) is | 807 | system (if it corresponds to a MIME charset) is treated as the |
| 808 | treated as the default coding system list. Among them, the first one | 808 | default coding system list. Among them, the first one that safely |
| 809 | that safely encodes the text is normally selected silently and | 809 | encodes the text is normally selected silently and returned without |
| 810 | returned without any user interaction. See also the command | 810 | any user interaction. See also the command `prefer-coding-system'. |
| 811 | `prefer-coding-system'. | ||
| 812 | 811 | ||
| 813 | However, the user is queried if the chosen coding system is | 812 | However, the user is queried if the chosen coding system is |
| 814 | inconsistent with what would be selected by `find-auto-coding' from | 813 | inconsistent with what would be selected by `find-auto-coding' from |
| @@ -832,8 +831,8 @@ Optional 5th arg FILE is the file name to use for this purpose. | |||
| 832 | That is different from `buffer-file-name' when handling `write-region' | 831 | That is different from `buffer-file-name' when handling `write-region' |
| 833 | \(for example). | 832 | \(for example). |
| 834 | 833 | ||
| 835 | The variable `select-safe-coding-system-accept-default-p', if | 834 | The variable `select-safe-coding-system-accept-default-p', if non-nil, |
| 836 | non-nil, overrides ACCEPT-DEFAULT-P. | 835 | overrides ACCEPT-DEFAULT-P. |
| 837 | 836 | ||
| 838 | Kludgy feature: if FROM is a string, the string is the target text, | 837 | Kludgy feature: if FROM is a string, the string is the target text, |
| 839 | and TO is ignored." | 838 | and TO is ignored." |
| @@ -1061,8 +1060,8 @@ Meaningful values for KEY include | |||
| 1061 | language environment. | 1060 | language environment. |
| 1062 | exit-function value is a function to call to leave this | 1061 | exit-function value is a function to call to leave this |
| 1063 | language environment. | 1062 | language environment. |
| 1064 | coding-system value is a list of coding systems that are good | 1063 | coding-system value is a list of coding systems that are good for |
| 1065 | for saving text written in this language environment. | 1064 | saving text written in this language environment. |
| 1066 | This list serves as suggestions to the user; | 1065 | This list serves as suggestions to the user; |
| 1067 | in effect, as a kind of documentation. | 1066 | in effect, as a kind of documentation. |
| 1068 | coding-priority value is a list of coding systems for this language | 1067 | coding-priority value is a list of coding systems for this language |
| @@ -1078,21 +1077,18 @@ Meaningful values for KEY include | |||
| 1078 | features value is a list of features requested in this | 1077 | features value is a list of features requested in this |
| 1079 | language environment. | 1078 | language environment. |
| 1080 | ctext-non-standard-encodings | 1079 | ctext-non-standard-encodings |
| 1081 | value is a list of non-standard encoding | 1080 | value is a list of non-standard encoding names used |
| 1082 | names used in extended segments of CTEXT. | 1081 | in extended segments of CTEXT. See the variable |
| 1083 | See the variable | 1082 | `ctext-non-standard-encodings' for more detail. |
| 1084 | `ctext-non-standard-encodings' for more | ||
| 1085 | detail. | ||
| 1086 | 1083 | ||
| 1087 | The following keys take effect only when multibyte characters are | 1084 | The following keys take effect only when multibyte characters are |
| 1088 | globally disabled, i.e. the value of `default-enable-multibyte-characters' | 1085 | globally disabled, i.e. the value of `default-enable-multibyte-characters' |
| 1089 | is nil. | 1086 | is nil. |
| 1090 | 1087 | ||
| 1091 | unibyte-display value is a coding system to encode characters | 1088 | unibyte-display value is a coding system to encode characters for |
| 1092 | for the terminal. Characters in the range | 1089 | the terminal. Characters in the range of 160 to |
| 1093 | of 160 to 255 display not as octal escapes, | 1090 | 255 display not as octal escapes, but as non-ASCII |
| 1094 | but as non-ASCII characters in this language | 1091 | characters in this language environment.") |
| 1095 | environment.") | ||
| 1096 | 1092 | ||
| 1097 | (defun get-language-info (lang-env key) | 1093 | (defun get-language-info (lang-env key) |
| 1098 | "Return information listed under KEY for language environment LANG-ENV. | 1094 | "Return information listed under KEY for language environment LANG-ENV. |
| @@ -1269,10 +1265,8 @@ Each function is called with one arg, LEIM directory name.") | |||
| 1269 | 1265 | ||
| 1270 | (defun update-leim-list-file (&rest dirs) | 1266 | (defun update-leim-list-file (&rest dirs) |
| 1271 | "Update LEIM list file in directories DIRS." | 1267 | "Update LEIM list file in directories DIRS." |
| 1272 | (let ((functions update-leim-list-functions)) | 1268 | (dolist (function update-leim-list-functions) |
| 1273 | (while functions | 1269 | (apply function dirs))) |
| 1274 | (apply (car functions) dirs) | ||
| 1275 | (setq functions (cdr functions))))) | ||
| 1276 | 1270 | ||
| 1277 | (defvar current-input-method nil | 1271 | (defvar current-input-method nil |
| 1278 | "The current input method for multilingual text. | 1272 | "The current input method for multilingual text. |
| @@ -1468,18 +1462,17 @@ To deactivate it programmatically, use `inactivate-input-method'." | |||
| 1468 | "Enable or disable multilingual text input method for the current buffer. | 1462 | "Enable or disable multilingual text input method for the current buffer. |
| 1469 | Only one input method can be enabled at any time in a given buffer. | 1463 | Only one input method can be enabled at any time in a given buffer. |
| 1470 | 1464 | ||
| 1471 | The normal action is to enable an input method if none was | 1465 | The normal action is to enable an input method if none was enabled, |
| 1472 | enabled, and disable the current one otherwise. Which input method | 1466 | and disable the current one otherwise. Which input method to enable |
| 1473 | to enable can be determined in various ways--either the one most | 1467 | can be determined in various ways--either the one most recently used, |
| 1474 | recently used, or the one specified by `default-input-method', or | 1468 | or the one specified by `default-input-method', or as a last resort |
| 1475 | as a last resort by reading the name of an input method in the | 1469 | by reading the name of an input method in the minibuffer. |
| 1476 | minibuffer. | ||
| 1477 | 1470 | ||
| 1478 | With a prefix argument, read an input method name with the minibuffer | 1471 | With a prefix argument ARG, read an input method name with the minibuffer |
| 1479 | and enable that one. The default is the most recent input method specified | 1472 | and enable that one. The default is the most recent input method specified |
| 1480 | \(not including the currently active input method, if any). | 1473 | \(not including the currently active input method, if any). |
| 1481 | 1474 | ||
| 1482 | When called interactively, the optional arg INTERACTIVE is non-nil, | 1475 | When called interactively, the optional argument INTERACTIVE is non-nil, |
| 1483 | which marks the variable `default-input-method' as set for Custom buffers." | 1476 | which marks the variable `default-input-method' as set for Custom buffers." |
| 1484 | 1477 | ||
| 1485 | (interactive "P\np") | 1478 | (interactive "P\np") |
| @@ -1552,11 +1545,10 @@ This is a subroutine for `describe-input-method'." | |||
| 1552 | (defun read-multilingual-string (prompt &optional initial-input input-method) | 1545 | (defun read-multilingual-string (prompt &optional initial-input input-method) |
| 1553 | "Read a multilingual string from minibuffer, prompting with string PROMPT. | 1546 | "Read a multilingual string from minibuffer, prompting with string PROMPT. |
| 1554 | The input method selected last time is activated in minibuffer. | 1547 | The input method selected last time is activated in minibuffer. |
| 1555 | If optional second arg INITIAL-INPUT is non-nil, insert it in the minibuffer | 1548 | If optional second argument INITIAL-INPUT is non-nil, insert it in the |
| 1556 | initially. | 1549 | minibuffer initially. |
| 1557 | Optional 3rd argument INPUT-METHOD specifies the input method | 1550 | Optional 3rd argument INPUT-METHOD specifies the input method to be activated |
| 1558 | to be activated instead of the one selected last time. It is a symbol | 1551 | instead of the one selected last time. It is a symbol or a string." |
| 1559 | or a string." | ||
| 1560 | (setq input-method | 1552 | (setq input-method |
| 1561 | (or input-method | 1553 | (or input-method |
| 1562 | current-input-method | 1554 | current-input-method |
| @@ -1631,8 +1623,8 @@ just inactivated." | |||
| 1631 | "This flag controls when an input method returns. | 1623 | "This flag controls when an input method returns. |
| 1632 | Usually, the input method does not return while there's a possibility | 1624 | Usually, the input method does not return while there's a possibility |
| 1633 | that it may find a different translation if a user types another key. | 1625 | that it may find a different translation if a user types another key. |
| 1634 | But, if this flag is non-nil, the input method returns as soon as | 1626 | But, if this flag is non-nil, the input method returns as soon as the |
| 1635 | the current key sequence gets long enough to have some valid translation.") | 1627 | current key sequence gets long enough to have some valid translation.") |
| 1636 | 1628 | ||
| 1637 | (defcustom input-method-use-echo-area nil | 1629 | (defcustom input-method-use-echo-area nil |
| 1638 | "This flag controls how an input method shows an intermediate key sequence. | 1630 | "This flag controls how an input method shows an intermediate key sequence. |
| @@ -1871,8 +1863,8 @@ the environment. Use \\[describe-language-environment] to find the environment' | |||
| 1871 | This option is intended for use at startup. Removing items doesn't | 1863 | This option is intended for use at startup. Removing items doesn't |
| 1872 | remove them from the language info until you next restart Emacs. | 1864 | remove them from the language info until you next restart Emacs. |
| 1873 | 1865 | ||
| 1874 | Setting this variable directly does not take effect. See | 1866 | Setting this variable directly does not take effect. |
| 1875 | `set-language-info-alist' for use in programs." | 1867 | See `set-language-info-alist' for use in programs." |
| 1876 | :group 'mule | 1868 | :group 'mule |
| 1877 | :version "23.1" | 1869 | :version "23.1" |
| 1878 | :set (lambda (s v) | 1870 | :set (lambda (s v) |
| @@ -2394,7 +2386,7 @@ Return the value corresponding to the first regexp that matches the | |||
| 2394 | start of KEY, or nil if there is no match." | 2386 | start of KEY, or nil if there is no match." |
| 2395 | (let (element) | 2387 | (let (element) |
| 2396 | (while (and alist (not element)) | 2388 | (while (and alist (not element)) |
| 2397 | (if (string-match (concat "\\`\\(?:" (car (car alist)) "\\)") key) | 2389 | (if (string-match-p (concat "\\`\\(?:" (car (car alist)) "\\)") key) |
| 2398 | (setq element (car alist))) | 2390 | (setq element (car alist))) |
| 2399 | (setq alist (cdr alist))) | 2391 | (setq alist (cdr alist))) |
| 2400 | (cdr element))) | 2392 | (cdr element))) |
| @@ -2728,7 +2720,7 @@ See also the documentation of `get-char-code-property' and | |||
| 2728 | (if slot | 2720 | (if slot |
| 2729 | (let (table value func) | 2721 | (let (table value func) |
| 2730 | (if (stringp (cdr slot)) | 2722 | (if (stringp (cdr slot)) |
| 2731 | (load (cdr slot))) | 2723 | (load (cdr slot) nil t)) |
| 2732 | (setq table (cdr slot) | 2724 | (setq table (cdr slot) |
| 2733 | value (aref table char) | 2725 | value (aref table char) |
| 2734 | func (char-table-extra-slot table 1)) | 2726 | func (char-table-extra-slot table 1)) |
| @@ -2744,7 +2736,7 @@ It can be retrieved with `(get-char-code-property CHAR PROPNAME)'." | |||
| 2744 | (if slot | 2736 | (if slot |
| 2745 | (let (table func) | 2737 | (let (table func) |
| 2746 | (if (stringp (cdr slot)) | 2738 | (if (stringp (cdr slot)) |
| 2747 | (load (cdr slot))) | 2739 | (load (cdr slot) nil t)) |
| 2748 | (setq table (cdr slot) | 2740 | (setq table (cdr slot) |
| 2749 | func (char-table-extra-slot table 2)) | 2741 | func (char-table-extra-slot table 2)) |
| 2750 | (if (functionp func) | 2742 | (if (functionp func) |
| @@ -2763,7 +2755,7 @@ If there's no description string for VALUE, return nil." | |||
| 2763 | (if slot | 2755 | (if slot |
| 2764 | (let (table func) | 2756 | (let (table func) |
| 2765 | (if (stringp (cdr slot)) | 2757 | (if (stringp (cdr slot)) |
| 2766 | (load (cdr slot))) | 2758 | (load (cdr slot) nil t)) |
| 2767 | (setq table (cdr slot) | 2759 | (setq table (cdr slot) |
| 2768 | func (char-table-extra-slot table 3)) | 2760 | func (char-table-extra-slot table 3)) |
| 2769 | (if (functionp func) | 2761 | (if (functionp func) |
| @@ -2849,7 +2841,8 @@ on encoding." | |||
| 2849 | (or ucs-names | 2841 | (or ucs-names |
| 2850 | (setq ucs-names | 2842 | (setq ucs-names |
| 2851 | (let (name names) | 2843 | (let (name names) |
| 2852 | (dotimes (c #xEFFFF) | 2844 | (dotimes-with-progress-reporter (c #xEFFFF) |
| 2845 | "Loading Unicode character names..." | ||
| 2853 | (unless (or | 2846 | (unless (or |
| 2854 | (and (>= c #x3400 ) (<= c #x4dbf )) ; CJK Ideograph Extension A | 2847 | (and (>= c #x3400 ) (<= c #x4dbf )) ; CJK Ideograph Extension A |
| 2855 | (and (>= c #x4e00 ) (<= c #x9fff )) ; CJK Ideograph | 2848 | (and (>= c #x4e00 ) (<= c #x9fff )) ; CJK Ideograph |
| @@ -2877,9 +2870,9 @@ for decimal. Returns a character as a number." | |||
| 2877 | (let* ((completion-ignore-case t) | 2870 | (let* ((completion-ignore-case t) |
| 2878 | (input (completing-read prompt ucs-completions))) | 2871 | (input (completing-read prompt ucs-completions))) |
| 2879 | (cond | 2872 | (cond |
| 2880 | ((string-match "^[0-9a-fA-F]+$" input) | 2873 | ((string-match-p "^[0-9a-fA-F]+$" input) |
| 2881 | (string-to-number input 16)) | 2874 | (string-to-number input 16)) |
| 2882 | ((string-match "^#" input) | 2875 | ((string-match-p "^#" input) |
| 2883 | (read input)) | 2876 | (read input)) |
| 2884 | (t | 2877 | (t |
| 2885 | (cdr (assoc-string input (ucs-names) t)))))) | 2878 | (cdr (assoc-string input (ucs-names) t)))))) |