From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner 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: Tue, 26 Sep 2023 17:55:37 -0700 Message-ID: <87bkdoh1gy.fsf@breatheoutbreathe.in> 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> Reply-To: Joseph Turner Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26195"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, 66187@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 27 03:04:22 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 1qlIyS-0006VW-E9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Sep 2023 03:04:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlIy1-0002jE-9v; Tue, 26 Sep 2023 21:03:53 -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 1qlIxw-0002iT-SP for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 21:03:48 -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 1qlIxw-0007LX-KF for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 21:03:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qlIy9-0003y5-Hl for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 21:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Sep 2023 01:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66187 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: Philip Kaludercic , "Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors" , 66187@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169577663215237 (code B ref -1); Wed, 27 Sep 2023 01:04:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Sep 2023 01:03:52 +0000 Original-Received: from localhost ([127.0.0.1]:50121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlIy0-0003xg-E9 for submit@debbugs.gnu.org; Tue, 26 Sep 2023 21:03:52 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:55968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlIxw-0003xP-W2 for submit@debbugs.gnu.org; Tue, 26 Sep 2023 21:03:51 -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 1qlIxe-0002h5-6n for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 21:03:30 -0400 Original-Received: from out-195.mta0.migadu.com ([2001:41d0:1004:224b::c3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlIxS-0006th-J3 for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 21:03:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1695776594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lY4jDIp/TdGOkfJ8bo+8ykV/cng1PutlO25ArFRNpsI=; b=EULKiPFk6tM0n4EdPo/05bfa5cR1PHXtZwZPIzOh92qfswMXpJJHgHpZgEswmH95e5/55e UCPwVvM4kvVvvmsHToG+9pO5T42YvcRd2m5yR38gDpyHvNSLFSFKG8m4/05I/hK9f9/L4a Y3+732Hwaa/ZyofQBRz8mragScbfiYI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <87msx8sbpv.fsf@web.de> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:1004:224b::c3; envelope-from=joseph@breatheoutbreathe.in; helo=out-195.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:271404 Archived-At: --=-=-= Content-Type: text/plain Michael Heerdegen writes: > Ah - ok, now finally I've understood all the parts. > > You want to prompt for a directory that is either empty or not yet > existing. But with `read-file-name' you only get either (a) non-empty > directories accepted as input, or (b) failing completion of existing > non-empty directories, which makes it impossible to choose a directory > inside an existing directory. > > Yes, looks like a bug that this is not possible. It should be possible > to complete directory names that do not match. I'm happy to work on the bug, if others agree that this change is desired. > Then the documentation needs to be improved: what exactly is accepted > when both MUSTMATCH and PREDICATE are specified? I can improve the docs too, once I have the answer that questions. > Finally, I think the docstring of `read-directory-name' needs to be > updated: it fails to mention that MUSTMATCH can be a function (the > argument is passed directly to `read-file-name'). How about the attached patch? > Michael. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-MUSTMATCH-description-in-read-directory-name-doc.patch >From e0ea8501af4e0dfd9777879e44a07902f86d1a7e Mon Sep 17 00:00:00 2001 From: Joseph Turner Date: Tue, 26 Sep 2023 18:01:27 -0700 Subject: [PATCH] Fix MUSTMATCH description in read-directory-name docstring * lisp/files.el (read-directory-name) --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index b72f141c0ee..1fe124848b9 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -817,7 +817,7 @@ non-empty string that was inserted by this function. If the user exits with an empty minibuffer, this function returns an empty string. (This can happen only if the user erased the pre-inserted contents or if `insert-default-directory' is nil.) -Fourth arg MUSTMATCH non-nil means require existing directory's name. +Fourth arg MUSTMATCH is passed as-is to `read-file-name', which see. Non-nil and non-t means also require confirmation after completion. Fifth arg INITIAL specifies text to start with. DIR should be an absolute directory name. It defaults to -- 2.41.0 --=-=-=--