mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-15 03:11:54 -07:00
The substring completion style completes "foo-bar" as "*foo-bar*". The partial-completion completion style completes "foo-bar" as "foo*bar*". Previously, it was not possible to get completion of "foo-bar" to act as "*foo*bar*", e.g. combining the partial-completion and substring styles. This would be especially useful for things like project-find-file. Now it is possible by customizing the completion-pcm-leading-wildcard variable to a non-nil value. Furthermore, it's convenient to be able to run regular (completion-pcm-leading-wildcard=t, non-substring) partial-completion before running completion-pcm-leading-wildcard=nil partial-completion, since the former provides more narrowly targeted completions. It's possible to do this by customizing completion-styles. Just add '(partial-completion ((completion-pcm-leading-wildcard t))) and '(partial-completion ((completion-pcm-leading-wildcard nil))) in that order. Then the completion machinery will first run partial-completion with completion-pcm-leading-wildcard=t, and if that returns no completions, run partial-completion with completion-pcm-leading-wildcard=nil. * lisp/minibuffer.el (completion--nth-completion): Allow an element of completion-styles to contain a list of bindings. (completion-styles): Document that. (completion-pcm-leading-wildcard): Add. (completion-pcm--string->pattern): Check completion-pcm-leading-wildcard. (bug#70217) |
||
|---|---|---|
| .. | ||
| emacs | ||
| lispintro | ||
| lispref | ||
| man | ||
| misc | ||
| translations | ||