GNU bug report logs - #66187
read-file-name unexpected behavior when MUSTMATCH is a function

Previous Next

Package: emacs;

Reported by: Joseph Turner <joseph <at> breatheoutbreathe.in>

Date: Sun, 24 Sep 2023 21:51:02 UTC

Severity: normal

Done: Joseph Turner <joseph <at> breatheoutbreathe.in>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: philipk <at> posteo.net, 66187 <at> debbugs.gnu.org
Subject: bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
Date: Tue, 26 Sep 2023 17:55:37 -0700
[Message part 1 (text/plain, inline)]
Michael Heerdegen <michael_heerdegen <at> web.de> 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.

[0001-Fix-MUSTMATCH-description-in-read-directory-name-doc.patch (text/x-diff, attachment)]

This bug report was last modified 1 year and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.