Subject: bug#70217: [PATCH] Add substring-partial-completion style

From: Stefan Monnier <[email-masked]>
Date: Wed, 08 May 2024 13:14:34 -0400

> * lisp/minibuffer.el (completion-emacs22-use-pcm)
> (completion-substring-use-pcm): Add. (bug#70217)
> (completion-emacs22-try-completion)
> (completion-emacs22-all-completions): Check completion-emacs22-use-pcm.
> (completion-pcm--string->pattern, completion-pcm--find-all-completions)
> (completion-pcm-all-completions, completion-pcm--merge-try)
> (completion-pcm-try-completion): Add "startglob" optional argument and
> pass through.
> (completion-substring-try-completion)
> (completion-substring-all-completions): Check
> completion-substring-use-pcm and pass startglob=t.

I'm not super happy about this `startglob` everywhere.
Two things bother me about it:

- Its name and doc (in my view of what "glob" means, there's no such
  thing as a "leading glob"; I think you're talking about a leading
  wildcard (which is one of the things that can appear in a glob
  pattern)).
- Its spreading all over the place.

I don't have the time to dig into the second problem (which might be
fixable by combining this info into the `string` argument (which
wouldn't be just a string as more, so it could have too-far reaching
consequences)), but for the first I suspect a "standard" name for this
idea is `anchored`.

Other than that, I don't have a strong opinion on whether to introduce
the feature via new styles or as custom vars that affect
existing styles.  Either way works for me.

        Stefan