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#66187: read-file-name unexpected behavior when MUSTMATCH is a function Date: Sun, 28 Jan 2024 14:20:47 -0500 Message-ID: References: <87r0mni6m1.fsf@breatheoutbreathe.in> <87v8bx48ww.fsf@breatheoutbreathe.in> <87msx8sbpv.fsf@web.de> <87bkdoh1gy.fsf@breatheoutbreathe.in> <87h6ngs85e.fsf@web.de> <87ttr7nzyj.fsf@breatheoutbreathe.in> <83pm1u6f8l.fsf@gnu.org> <83fs2o2wb0.fsf@gnu.org> <83v8bj2794.fsf@gnu.org> <83r0m70zwp.fsf@gnu.org> <83sf6mzcz6.fsf@gnu.org> <878r72odzs.fsf@breatheoutbreathe.in> <87il4uvoob.fsf@breatheoutbreathe.in> <8734v7vsjy.fsf@breatheoutbreathe.in> <87a5otqggx.fsf@breatheoutbreathe.in> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7524"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: michael_heerdegen@web.de, Eli Zaretskii , philipk@posteo.net, 66187@debbugs.gnu.org To: Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 28 20:22:24 2024 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 1rUAjY-0001hG-BC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Jan 2024 20:22:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUAjB-0000GT-Rn; Sun, 28 Jan 2024 14:22:01 -0500 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 1rUAj8-0000G8-R1 for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 14:21:58 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUAj5-0000Y5-1j for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 14:21:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUAjC-0006XE-Ei for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 14:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jan 2024 19:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66187 X-GNU-PR-Package: emacs Original-Received: via spool by 66187-submit@debbugs.gnu.org id=B66187.170646966825030 (code B ref 66187); Sun, 28 Jan 2024 19:22:02 +0000 Original-Received: (at 66187) by debbugs.gnu.org; 28 Jan 2024 19:21:08 +0000 Original-Received: from localhost ([127.0.0.1]:58371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUAiK-0006Ve-4d for submit@debbugs.gnu.org; Sun, 28 Jan 2024 14:21:08 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUAiH-0006Uy-3A for 66187@debbugs.gnu.org; Sun, 28 Jan 2024 14:21:05 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E245710007D; Sun, 28 Jan 2024 14:20:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1706469649; bh=cXHNl+L4iX/QR6J5xqgUDtwzV10cygLO5ag1+P4qvGs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=h5HDM+9g00tgZMW4Aqyo7/PMeBljlEJbBFsCNQlW7NtT6pP9h/FS2DzKSVfAZ3QVU EJWlFd84PLkmEs8ip/kb1ux8Cd6pg/xAu67+W/MuLILIpk74egStsfj4IPUJqiPCs+ RfnBDNelz8nflqxEc1TURiPLOVDi13J7n9i5sJd1ot/miZZoKiSFMEoR2MVn2iHG5X JRD06kDDS1tBSDdw1LaZE+/xSEkqNNZQ95zhL6Y8m657O4V9YMLhQEK3FTmdDgM8XN H5Xik/kHTtlmEMGpJiRphfmobBozbPz/WBjsXfiYFbK+Gu1vRiggYcmwRJZnxOGxhS UCSAa12gB7dpQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D9C2F10001D; Sun, 28 Jan 2024 14:20:49 -0500 (EST) Original-Received: from alfajor (unknown [45.72.206.68]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 99ED2120749; Sun, 28 Jan 2024 14:20:49 -0500 (EST) In-Reply-To: <87a5otqggx.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Thu, 25 Jan 2024 12:53:10 -0800") 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:279101 Archived-At: > Ping! I hope a fix like this can be merged into Emacs 29 still :) Duh, I can't believe I left you waiting for so long, this is awful. I just pushed this to `emacs-29`, thank you. I hope there might still be a next time, so I get a chance to do better. Stefan > From 609bf4964f88b01f4843e29b2cf71ee1cd2f6125 Mon Sep 17 00:00:00 2001 > From: Joseph Turner > Date: Sun, 12 Nov 2023 13:21:50 -0800 > Subject: [PATCH] Fix completing-read functional REQUIRE-MATCH behavior > > * lisp/minibuffer.el (completion--complete-and-exit): If > minibuffer-completion-confirm is a function which returns nil, > immediately fail to complete. > > See bug#66187. > --- > lisp/minibuffer.el | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el > index 3e30b68d5e9..9fad3e71fad 100644 > --- a/lisp/minibuffer.el > +++ b/lisp/minibuffer.el > @@ -1847,10 +1847,13 @@ appear to be a match." > ;; Allow user to specify null string > ((= beg end) (funcall exit-function)) > ;; The CONFIRM argument is a predicate. > - ((and (functionp minibuffer-completion-confirm) > - (funcall minibuffer-completion-confirm > - (buffer-substring beg end))) > - (funcall exit-function)) > + ((functionp minibuffer-completion-confirm) > + (if (funcall minibuffer-completion-confirm > + (buffer-substring beg end)) > + (funcall exit-function) > + (unless completion-fail-discreetly > + (ding) > + (completion--message "No match")))) > ;; See if we have a completion from the table. > ((test-completion (buffer-substring beg end) > minibuffer-completion-table