From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64351: probabe bug associated with =?UTF-8?Q?=E2=80=9Ccompletion-regexp-list=E2=80=9D?= Date: Fri, 30 Jun 2023 14:33:49 -0400 Message-ID: References: <83v8f5sc6p.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2791"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Shynur Xie , 64351@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 30 20:34:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qFIwm-0000UO-If for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Jun 2023 20:34:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFIwW-0003AO-Ky; Fri, 30 Jun 2023 14:34:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFIwU-00038h-JF for bug-gnu-emacs@gnu.org; Fri, 30 Jun 2023 14:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFIwU-0005qB-Aq for bug-gnu-emacs@gnu.org; Fri, 30 Jun 2023 14:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qFIwU-0005s7-6d for bug-gnu-emacs@gnu.org; Fri, 30 Jun 2023 14:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Jun 2023 18:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64351 X-GNU-PR-Package: emacs Original-Received: via spool by 64351-submit@debbugs.gnu.org id=B64351.168815003822558 (code B ref 64351); Fri, 30 Jun 2023 18:34:02 +0000 Original-Received: (at 64351) by debbugs.gnu.org; 30 Jun 2023 18:33:58 +0000 Original-Received: from localhost ([127.0.0.1]:55759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFIwQ-0005rm-4S for submit@debbugs.gnu.org; Fri, 30 Jun 2023 14:33:58 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFIwP-0005rX-3H for 64351@debbugs.gnu.org; Fri, 30 Jun 2023 14:33:57 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D04AA8077C; Fri, 30 Jun 2023 14:33:51 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A776F8004C; Fri, 30 Jun 2023 14:33:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1688150030; bh=d32tSGBzIqjP+bNxbkdKqfr9o5F441Tmkxb8aBxRAgQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iwYgFdGjP8/Tpyf84CPu91ohXHOU9pd9BrkpKbpR2JgT4ub/RQqSIubn1ACeAphM4 HKvQ83Bk9GAee1GdEaTkp2Rzx2wZ2o7v6D5R4L6w7DfcuuNwLQB1G594RZWjdSteqA bR7rlff87r2opJTso3ugbiio8UfNfKTEd/VyNQmtBwRpeZEPHpByJ/9APBBX5bLcPz MwjE7AvRFFp04VTtnvlgE9m62zsKj77Lr95ZRbMNOQnYjUQ5DEswIAt5ijxLymXRmQ 640U4LJivFfGfhawujz2amiywu1nGgU6Q2L1ssjKz7nyd1KzXDtfkxkX2YGAiFV765 5H0jXkLBxTJWw== Original-Received: from pastel (69-165-155-162.dsl.teksavvy.com [69.165.155.162]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 81BDA1203CF; Fri, 30 Jun 2023 14:33:50 -0400 (EDT) In-Reply-To: <83v8f5sc6p.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 30 Jun 2023 09:21:02 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264328 Archived-At: >> Evaluate this: >> (setq completion-regexp-list '("^[^-]")) Bad idea. Admittedly, `completion-regexp-list` is documented poorly enough that it's not clear what usage is valid and what isn't, but a lot of completion code will be broken if you set it globally to anything else than nil. >> Then type =E2=80=9CC-h v -l TAB=E2=80=9D, an error will be thrown. > 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. Or alternatively to say "if it hurts, don't do that". Stefan