Subject: Re: bug#72425: 29.2.50; substring (and other PCM styles) fails with candidates containing newlines

From: Eli Zaretskii <[email-masked]>
Date: Thu, 15 Aug 2024 10:43:25 +0300

> Cc: [email-masked], Dmitry Gutov <[email-masked]>
> Date: Tue, 13 Aug 2024 20:51:28 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> > Patch to fix:
> >
> > From dfac112fa23d503b671fa5f9901411a4556bf054 Mon Sep 17 00:00:00 2001
> > From: Spencer Baugh <[email-masked]>
> > Date: Fri, 2 Aug 2024 12:15:58 -0400
> > Subject: [PATCH] Fix partial-completion for completion candidates containing
> >  newlines
> >
> > partial-completion tries to match a pattern containing wildcards (such
> > as `any' or `prefix') against completion candidates.  Wildcards are
> > supposed to match any sequence of characters, but
> > completion-pcm--pattern->regex transformed the wildcards into ".*",
> > which won't match sequences containing newlines.  Fix this to properly
> > match anything by using "[^z-a]*" instead.  (That's (rx (* anything)))
> 
> Looks fine to me.  I find [^z-a] a bit too magical, so maybe an `rx`
> pattern would be more clear.

Thanks, installed on master, and closing the bug.

> My guess is that completion of thingies with newlines is probably going
> to bump into other problems.  🙂

Exciting new bugs!