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: Fri, 06 Oct 2023 09:01:23 -0400 Message-ID: References: <87r0mni6m1.fsf@breatheoutbreathe.in> <87bkdq3nw6.fsf@web.de> <875y3yx221.fsf@breatheoutbreathe.in> <87pm260wh9.fsf@web.de> <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> 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="6999"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: michael_heerdegen@web.de, philipk@posteo.net, 66187@debbugs.gnu.org, joseph@breatheoutbreathe.in To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 06 15:02:41 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 1qokTY-0001Wk-8f for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Oct 2023 15:02:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qokT6-0003so-De; Fri, 06 Oct 2023 09:02:13 -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 1qokSe-0003lQ-RN for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2023 09:01:45 -0400 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 1qokSd-000639-1e for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2023 09:01:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qokSv-0000lY-MV for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2023 09:02:01 -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, 06 Oct 2023 13:02:01 +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.16965973152933 (code B ref 66187); Fri, 06 Oct 2023 13:02:01 +0000 Original-Received: (at 66187) by debbugs.gnu.org; 6 Oct 2023 13:01:55 +0000 Original-Received: from localhost ([127.0.0.1]:49392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qokSp-0000lE-B4 for submit@debbugs.gnu.org; Fri, 06 Oct 2023 09:01:55 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qokSn-0000l0-8t for 66187@debbugs.gnu.org; Fri, 06 Oct 2023 09:01:53 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 033AC8065C; Fri, 6 Oct 2023 09:01:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1696597287; bh=1GBtXVleJ3k1eSPfJFtyOfkvdFiqH/6hNMe/niWLcmE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=axuzJvc2Z4JlPSdOoGqkAUe4wbUTuNbZjHUu8sFZDMroQCX5oFd/KoS21NZYhFDfd bMoYxH/LCsE7DhNigANd8cwjfyyr/3383XCWmmRl93hzqBUAom2ujg6isrQpzyafO0 63KESp5spjeFG/7jaUetauKC5socCFgC28tZSYHSe2qwBjYOzeCZlMIUc1vRj1YXUi 7Qu5A2e+ACsviIA0Rs/2u5740XeR4+m9NJOii6O3VtVYk0DDQPy66UDaYIieSrUueG qHuj7SWEBCn6CA7T/0Yvzu5OsmGAUrEwnhuqvD3zVw2fDGGHlP46qJODyJ6Ji+RTAu xh1OOIOSmcsBg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 92022804AD; Fri, 6 Oct 2023 09:01:27 -0400 (EDT) Original-Received: from pastel (unknown [45.72.225.62]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8E90012041E; Fri, 6 Oct 2023 09:01:26 -0400 (EDT) In-Reply-To: <83fs2o2wb0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Oct 2023 07:45:39 +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:271942 Archived-At: >> >> For example, given: >> >> >> >> (completing-read "Prompt: " '("a" "b") nil >> >> (lambda (input) >> >> (string= "a" input))) >> >> >> >> I expected that the prompt would refuse to complete "b". I was wrong. >> >> >> >> Since completing-read is such a fundamental part of Emacs, I doubt it >> >> will be possible to change this behavior. What do you think about the >> >> attached patch to clarify the completing-read docstring? >> >> The use of a function as `require-match` is brand new in Emacs-29, so >> I think it's not too late to fix it. I think rather than fixing the doc >> we should fix the behavior, e.g. with the patch below. > > What change in behavior (wrt Emacs 29.1) does this patch cause? In the example he gave above it makes it so completion can be used to insert "b" but when you try to exit it refuses to exit. IOW it gives primacy to the `require-match` function over the completion-table w.r.t deciding when the minibuffer's content is acceptable or not. Code which wants the 29.1 behavior can easily get it by modifying their `require-match` function accordingly (and such code then works correctly both with Emacs-29.1 and with the new behavior). Stefan