mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
* lisp/minibuffer.el: Add metadata method to completion tables.
(completion-category-overrides): New defcustom. (completion-metadata, completion--field-metadata) (completion-metadata-get, completion--styles) (completion--cycle-threshold): New functions. (completion-try-completion, completion-all-completions): Add `metadata' argument to choose completion-styles. (completion--do-completion): Use metadata to choose cycling. (completion-all-sorted-completions): Use metadata for sorting. Remove :completion-cycle-penalty which is not needed any more. (completion--try-word-completion): Add `metadata' argument. (minibuffer-completion-help): Check metadata for annotation function and sorting. (completion-file-name-table): Return `category' metadata. (minibuffer-completing-file-name): Make obsolete. * lisp/simple.el (minibuffer-completing-symbol): Make obsolete. * lisp/icomplete.el (icomplete-completions): Pass new `metadata' param to completion-try-completion. * src/minibuf.c (Finternal_complete_buffer): Return `category' metadata. (read_minibuf): Use get_minibuffer. (syms_of_minibuf): Use DEFSYM. (Qmetadata): New var. * src/data.c (Qbuffer): Don't make it static. (syms_of_data): Use DEFSYM.
This commit is contained in:
parent
e003a29261
commit
620c53a664
8 changed files with 293 additions and 276 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue