Subject: bug#79265: [PATCH] Treat point more consistently in PCM completion

From: Dmitry Gutov <[email-masked]>
Date: Tue, 19 Aug 2025 07:04:02 +0300

On 18/08/2025 21:53, Spencer Baugh wrote:
> Properly fix bug#38458, which is fundamentally an issue with
> completion-ignore-case, by checking if the completions are
> unique ignoring case.  When the completions are unique, the
> normal code to delete a wildcard naturally causes point to be
> moved to the end of the minibuffer, which is the correct
> behavior.
> 
> Now that the bug is fixed properly, remove a hack which
> previously was used to "fix" it, which made point behave
> inconsistently if it was in the middle of the minibuffer versus
> at the end of the minibuffer.

Thanks, the description makes sense and the tests are great to have.

I wonder if Stefan will want to comment though.

Just one thing:

> +                                      ;; They're all the same string, ignoring case.
> +                                      (seq-every-p
> +                                       (lambda (elem) (string-equal-ignore-case elem prefix))
> +                                       comps)))))

Is this performance-sensitive? Using a less abstracted function like 
cl-every of even a (cl-loop for ... always ...) could be faster.

There is a (dolist) above it which iterates across segments of the 
pattern, so whatever overhead is added could be multiplied; OT2H I 
haven't tested it myself yet, maybe all bottlenecks are somewhere else.