* lisp/minibuffer.el: Add metadata method to completion tables.
[bpt/emacs.git] / lisp / icomplete.el
index ab67fcf..5f36806 100644 (file)
@@ -287,6 +287,7 @@ matches exist.  \(Keybindings for uniquely matched commands
 are exhibited within the square braces.)"
 
   (let* ((non-essential t)
+         (md (completion--field-metadata (field-beginning)))
         (comps (completion-all-sorted-completions))
          (last (if (consp comps) (last comps)))
          (base-size (cdr last))
@@ -299,11 +300,11 @@ are exhibited within the square braces.)"
       (let* ((most-try
               (if (and base-size (> base-size 0))
                   (completion-try-completion
-                   name candidates predicate (length name))
+                   name candidates predicate (length name) md)
                 ;; If the `comps' are 0-based, the result should be
                 ;; the same with `comps'.
                 (completion-try-completion
-                 name comps nil (length name))))
+                 name comps nil (length name) md)))
             (most (if (consp most-try) (car most-try)
                      (if most-try (car comps) "")))
              ;; Compare name and most, so we can determine if name is