]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/international/mule-cmds.el (ucs-completions): Remove.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 12 Sep 2011 02:18:23 +0000 (22:18 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 12 Sep 2011 02:18:23 +0000 (22:18 -0400)
(read-char-by-name): Use complete-with-action instead; add metadata.

lisp/ChangeLog
lisp/international/mule-cmds.el

index a8d55c4cc1416cbf70f166c7fdff09dd47a8dd59..139863e4a584abedfa0e0ea0fcd61dac96064e6a 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * international/mule-cmds.el (ucs-completions): Remove.
+       (read-char-by-name): Use complete-with-action instead; add metadata.
+
 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
 
        * window.el (display-buffer--action-function-custom-type)
@@ -19,8 +24,8 @@
        Use switch-to-buffer.
 
        * cus-edit.el (customize-group, custom-buffer-create)
-       (customize-browse, custom-buffer-create-other-window): Use
-       switch-to-buffer or switch-to-buffer-other-window.
+       (customize-browse, custom-buffer-create-other-window):
+       Use switch-to-buffer or switch-to-buffer-other-window.
 
        * info.el (info, Info-find-node, Info-revert-find-node, Info-next)
        (Info-prev, Info-up, Info-speedbar-goto-node)
@@ -86,8 +91,8 @@
        (mail-other-window): Use switch-to-buffer-other-window.
        (mail-other-frame): USe switch-to-buffer-other-frame.
 
-       * progmodes/gdb-mi.el (gdb-frame-gdb-buffer): Use
-       display-buffer-other-frame.
+       * progmodes/gdb-mi.el (gdb-frame-gdb-buffer):
+       Use display-buffer-other-frame.
        (gdb-display-gdb-buffer): Use pop-to-buffer.
 
        * progmodes/gud.el (gud-goto-info): Use info-other-window.
        (display-buffer-use-some-window): Don't perform any special
        pop-up-frames handling.
        (pop-to-buffer): Use window-normalize-buffer-to-switch-to.
-       (display-buffer--maybe-same-window): Renamed from
+       (display-buffer--maybe-same-window): Rename from
        display-buffer-maybe-same-window.
 
        * info.el: Don't set same-window-regexps.
 
 2011-09-03  Chong Yidong  <cyd@stupidchicken.com>
 
-       * mail/sendmail.el (sendmail-query-once-function): Deleted.
+       * mail/sendmail.el (sendmail-query-once-function): Delete.
        (sendmail-query-once): Save directly to send-mail-function.
        Update message-send-mail-function too.
 
        start python interpreter from menu-bar (as reported by Geert
        Kloosterman).
        (inferior-python-mode-map): Fix typo.
-       (python-shell-map): Removed.
+       (python-shell-map): Remove.
 
 2011-09-03  Deniz Dogan  <deniz@dogan.se>
 
        * window.el (window-deletable-p): Don't return a non-nil value
        when there's a buffer that was shown in the window before.
        (Bug#9419)
-       (display-buffer-pop-up-frame, display-buffer-pop-up-window): Set
-       window's previous buffers to nil.
+       (display-buffer-pop-up-frame, display-buffer-pop-up-window):
+       Set window's previous buffers to nil.
 
 2011-09-03  Eli Zaretskii  <eliz@gnu.org>
 
 
 2011-09-02  Chong Yidong  <cyd@stupidchicken.com>
 
-       * window.el (pop-to-buffer-1, pop-to-buffer-same-window): Deleted.
+       * window.el (pop-to-buffer-1, pop-to-buffer-same-window): Delete.
        (pop-to-buffer): Change interactive spec.  Pass second argument
        directly to display-buffer.
        (display-buffer): Fix interactive spec.  Use functionp to
        (display-buffer-reuse-or-pop-window)
        (display-buffer-use-some-window): New functions.
        (display-buffer-default-action): Use them.
-       (display-buffer-default): Deleted.
+       (display-buffer-default): Delete.
        (pop-to-buffer-1): Fix choice of actions.
 
 2011-09-02  Stefan Monnier  <monnier@iro.umontreal.ca>
index 128fb86b7b46c7d33ec12eec61249a1f537f62c3..3276447e72fa13de02cf68522c5838118ae15703 100644 (file)
@@ -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))