all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: 72425@debbugs.gnu.org
Cc: Dmitry Gutov <dmitry@gutov.dev>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#72425: 29.2.50; substring (and other PCM styles) fails with candidates containing newlines
Date: Fri, 02 Aug 2024 12:17:19 -0400	[thread overview]
Message-ID: <iermslurjao.fsf@janestreet.com> (raw)
In-Reply-To: <ierplqqrjen.fsf@janestreet.com> (Spencer Baugh's message of "Fri, 02 Aug 2024 12:14:56 -0400")

[-- Attachment #1: Type: text/plain, Size: 16 bytes --]


Patch to fix:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-partial-completion-for-completion-candidates-con.patch --]
[-- Type: text/x-patch, Size: 1417 bytes --]

From dfac112fa23d503b671fa5f9901411a4556bf054 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@janestreet.com>
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)))

* lisp/minibuffer.el (completion-pcm--pattern->regex): Fix
regex. (bug#72425)
---
 lisp/minibuffer.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 5860c4238c2..cefd4247370 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3896,7 +3896,7 @@ completion-pcm--pattern->regex
                      (t
                       (let ((re (if (eq x 'any-delim)
                                     (concat completion-pcm--delim-wild-regex "*?")
-                                  ".*?")))
+                                  "[^z-a]*?")))
                         (if (if (consp group) (memq x group) group)
                             (concat "\\(" re "\\)")
                           re)))))
-- 
2.39.3


  reply	other threads:[~2024-08-02 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 16:14 bug#72425: 29.2.50; substring (and other PCM styles) fails with candidates containing newlines Spencer Baugh
2024-08-02 16:17 ` Spencer Baugh [this message]
2024-08-14  0:51   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-15  7:43     ` Eli Zaretskii
2024-08-02 16:24 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-02 19:32   ` Spencer Baugh
2024-08-02 21:22     ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iermslurjao.fsf@janestreet.com \
    --to=sbaugh@janestreet.com \
    --cc=72425@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.