1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-15 03:11:54 -07:00
emacs/doc
Spencer Baugh 69ec333eab 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)
2024-08-24 12:20:56 +03:00
..
emacs Allow customizing partial-completion to be more like substring 2024-08-24 12:20:56 +03:00
lispintro ; Fix punctuation in docs 2024-07-21 17:35:13 +02:00
lispref Fix two issues with 'window-deletable-p' 2024-08-21 10:54:53 +02:00
man ; Fix punctuation in docs 2024-07-21 17:35:13 +02:00
misc Update to modus-themes version 4.5.0 2024-08-21 11:07:47 +03:00
translations ; Fix typos 2024-06-07 23:51:18 +02:00