; 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'.