summaryrefslogtreecommitdiff
path: root/lisp/international/mule-cmds.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-09-11 22:18:23 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2011-09-11 22:18:23 -0400
commit393a301e80860e90ba0ba718d29a2d72bc00eff7 (patch)
tree68032e6a16caeab5985d76f899433b3293548fa8 /lisp/international/mule-cmds.el
parentaa357b80f9c4582375f3cf0ed96490713b164f64 (diff)
downloademacs-393a301e80860e90ba0ba718d29a2d72bc00eff7.tar.gz
* lisp/international/mule-cmds.el (ucs-completions): Remove.
(read-char-by-name): Use complete-with-action instead; add metadata.
Diffstat (limited to 'lisp/international/mule-cmds.el')
-rw-r--r--lisp/international/mule-cmds.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 128fb86b7b4..3276447e72f 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2914,10 +2914,6 @@ on encoding."
(setq c (1+ c))))
(setq ucs-names names))))
-(defvar ucs-completions (lazy-completion-table ucs-completions ucs-names)
- "Lazy completion table for completing on Unicode character names.")
-(put 'ucs-completions 'risky-local-variable t)
-
(defun read-char-by-name (prompt)
"Read a character by its Unicode name or hex number string.
Display PROMPT and read a string that represents a character by its
@@ -2935,7 +2931,12 @@ This function also accepts a hexadecimal number of Unicode code
point or a number in hash notation, e.g. #o21430 for octal,
#x2318 for hex, or #10r8984 for decimal."
(let* ((completion-ignore-case t)
- (input (completing-read prompt ucs-completions)))
+ (input (completing-read
+ prompt
+ (lambda (string pred action)
+ (if (eq action 'metadata)
+ '(metadata (category . unicode-name))
+ (complete-with-action action (ucs-names) string pred))))))
(cond
((string-match-p "^[0-9a-fA-F]+$" input)
(string-to-number input 16))