Subject: bug#64351: probabe bug associated with “completion-regexp-list”

From: Eli Zaretskii <[email-masked]>
Date: Sat, 01 Jul 2023 11:21:07 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: Shynur Xie <[email-masked]>,  [email-masked]
> Date: Fri, 30 Jun 2023 14:33:49 -0400
> 
> > Stefan, is the below the right fix?  If it is, do you think it is safe
> > enough for the release branch?
> >
> > diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
> > index 4aa1ab3..3e30b68 100644
> > --- a/lisp/minibuffer.el
> > +++ b/lisp/minibuffer.el
> > @@ -4027,7 +4027,8 @@ completion-pcm--merge-completions
> >                (setq ccs (nreverse ccs))
> >                (let* ((prefix (try-completion fixed comps))
> >                       (unique (or (and (eq prefix t) (setq prefix fixed))
> > -                                 (eq t (try-completion prefix comps)))))
> > +                                 (and (stringp prefix)
> > +                                      (eq t (try-completion prefix comps))))))
> >                  (unless (or (eq elem 'prefix)
> >                              (equal prefix ""))
> >                    (push prefix res))
> 
> I'd argue that the better fix is to let-bind `completion-regexp-list` to
> nil around the `minibuffer.el` code which uses
> `try/all/test-completion` to protect against those kinds of misuses.

You are saying that you don't like my proposed patch for the emacs-29
branch, and would even prefer to leave it unfixed?

The binding you propose might be appropriate for master, but not for
the release branch.

> Or alternatively to say "if it hurts, don't do that".

That could be okay, if we also say how to use this variable so it
doesn't hurt.