diff options
| author | Spencer Baugh | 2024-08-21 11:59:42 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2024-08-24 12:20:56 +0300 |
| commit | 69ec333eab0b801949d33ef5ae505addc9061793 (patch) | |
| tree | 4664f2b893670d39efc39c1c88f9d24ef5428d12 /java | |
| parent | a7a22e7c22cef0948f84daa86c9929d7b0dd6d56 (diff) | |
| download | emacs-69ec333eab0b801949d33ef5ae505addc9061793.tar.gz emacs-69ec333eab0b801949d33ef5ae505addc9061793.zip | |
Allow customizing partial-completion to be more like substring
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)
Diffstat (limited to 'java')
0 files changed, 0 insertions, 0 deletions