]> git.eshelyaron.com Git - emacs.git/commit
; Allow completion tables to adjust 'minibuffer-completion-base'
authorEshel Yaron <me@eshelyaron.com>
Mon, 22 Jan 2024 16:39:11 +0000 (17:39 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 22 Jan 2024 16:39:11 +0000 (17:39 +0100)
commit2a64d732c7736e1b79d07f7bcb363875e097952a
tree0cdee0b64d120b1b15bded5dc84a7e64b48d473b
parent265ec6007a606a36ca7e35214b3c9cc238244aed
; Allow completion tables to adjust 'minibuffer-completion-base'

This adds a new completion metadata function 'adjust-base-function'
that completion tables can provide in order to adjust
'minibuffer-completion-base' around calls to completions sorting and
annotation functions.  In particular, this allows 'c-r-m' to remove
inputs that end before the current partial input from
'minibuffer-completion-base', to avoid throwing off functions that
treat 'minibuffer-completion-base' as a prefix of the set of
completion candidates, e.g. the directory part in file completion.

* lisp/minibuffer.el (completion-metadata): New completion metadata
entry 'adjust-base-function'.
(completion-all-sorted-completions, minibuffer-completion-help): Use
it to adjust 'minibuffer-completion-base'.

* lisp/emacs-lisp/crm.el (crm--table): Extend metadata with an
'adjust-base-function'.
lisp/emacs-lisp/crm.el
lisp/minibuffer.el