aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2008-11-18 01:35:25 +0000
committerJuanma Barranquero2008-11-18 01:35:25 +0000
commitd0d8885d3f97b134a7fc532ad864352fccad26e3 (patch)
tree335b20f5c3552d122973ad795b39e50187a3a56a
parent22854006f0135c511c54c1fa1300f9e18a39964a (diff)
downloademacs-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/ChangeLog19
-rw-r--r--lisp/international/mule-cmds.el109
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 @@
12008-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
12008-11-17 Chong Yidong <cyd@stupidchicken.com> 172008-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
82008-11-17 Juanma Barranquero <lekktu@gmail.com> 232008-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
381system, and Emacs automatically sets the default to that coding system at 381system, and Emacs automatically sets the default to that coding system at
382startup. 382startup.
383 383
384A coding system that requires automatic detection of text 384A 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
513This only finds coding systems of type `charset', whose 513This 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
515ascii-compatible coding systems). It was used in older versions of 515ASCII-compatible coding systems). It was used in older versions of
516Emacs, but is unlikely to be what you really want now." 516Emacs, 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
802between FROM and TO are shown in a popup window. Among them, the most 802between FROM and TO are shown in a popup window. Among them, the most
803proper one is suggested as the default. 803proper one is suggested as the default.
804 804
805The list of `buffer-file-coding-system' of the current buffer, 805The list of `buffer-file-coding-system' of the current buffer, the
806the `default-buffer-file-coding-system', and the 806`default-buffer-file-coding-system', and the most preferred coding
807most preferred coding system (if it corresponds to a MIME charset) is 807system (if it corresponds to a MIME charset) is treated as the
808treated as the default coding system list. Among them, the first one 808default coding system list. Among them, the first one that safely
809that safely encodes the text is normally selected silently and 809encodes the text is normally selected silently and returned without
810returned without any user interaction. See also the command 810any user interaction. See also the command `prefer-coding-system'.
811`prefer-coding-system'.
812 811
813However, the user is queried if the chosen coding system is 812However, the user is queried if the chosen coding system is
814inconsistent with what would be selected by `find-auto-coding' from 813inconsistent 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.
832That is different from `buffer-file-name' when handling `write-region' 831That is different from `buffer-file-name' when handling `write-region'
833\(for example). 832\(for example).
834 833
835The variable `select-safe-coding-system-accept-default-p', if 834The variable `select-safe-coding-system-accept-default-p', if non-nil,
836non-nil, overrides ACCEPT-DEFAULT-P. 835overrides ACCEPT-DEFAULT-P.
837 836
838Kludgy feature: if FROM is a string, the string is the target text, 837Kludgy feature: if FROM is a string, the string is the target text,
839and TO is ignored." 838and 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
1087The following keys take effect only when multibyte characters are 1084The following keys take effect only when multibyte characters are
1088globally disabled, i.e. the value of `default-enable-multibyte-characters' 1085globally disabled, i.e. the value of `default-enable-multibyte-characters'
1089is nil. 1086is 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.
1469Only one input method can be enabled at any time in a given buffer. 1463Only one input method can be enabled at any time in a given buffer.
1470 1464
1471The normal action is to enable an input method if none was 1465The normal action is to enable an input method if none was enabled,
1472enabled, and disable the current one otherwise. Which input method 1466and disable the current one otherwise. Which input method to enable
1473to enable can be determined in various ways--either the one most 1467can be determined in various ways--either the one most recently used,
1474recently used, or the one specified by `default-input-method', or 1468or the one specified by `default-input-method', or as a last resort
1475as a last resort by reading the name of an input method in the 1469by reading the name of an input method in the minibuffer.
1476minibuffer.
1477 1470
1478With a prefix argument, read an input method name with the minibuffer 1471With a prefix argument ARG, read an input method name with the minibuffer
1479and enable that one. The default is the most recent input method specified 1472and 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
1482When called interactively, the optional arg INTERACTIVE is non-nil, 1475When called interactively, the optional argument INTERACTIVE is non-nil,
1483which marks the variable `default-input-method' as set for Custom buffers." 1476which 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.
1554The input method selected last time is activated in minibuffer. 1547The input method selected last time is activated in minibuffer.
1555If optional second arg INITIAL-INPUT is non-nil, insert it in the minibuffer 1548If optional second argument INITIAL-INPUT is non-nil, insert it in the
1556initially. 1549minibuffer initially.
1557Optional 3rd argument INPUT-METHOD specifies the input method 1550Optional 3rd argument INPUT-METHOD specifies the input method to be activated
1558to be activated instead of the one selected last time. It is a symbol 1551instead of the one selected last time. It is a symbol or a string."
1559or 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.
1632Usually, the input method does not return while there's a possibility 1624Usually, the input method does not return while there's a possibility
1633that it may find a different translation if a user types another key. 1625that it may find a different translation if a user types another key.
1634But, if this flag is non-nil, the input method returns as soon as 1626But, if this flag is non-nil, the input method returns as soon as the
1635the current key sequence gets long enough to have some valid translation.") 1627current 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'
1871This option is intended for use at startup. Removing items doesn't 1863This option is intended for use at startup. Removing items doesn't
1872remove them from the language info until you next restart Emacs. 1864remove them from the language info until you next restart Emacs.
1873 1865
1874Setting this variable directly does not take effect. See 1866Setting this variable directly does not take effect.
1875`set-language-info-alist' for use in programs." 1867See `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
2394start of KEY, or nil if there is no match." 2386start 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))))))