[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read-directory-name, the unloved

From: Antoine Levitt
Subject: Re: read-directory-name, the unloved
Date: Sat, 12 Feb 2011 11:18:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

12/02/11 03:03, Stefan Monnier
> The code you remove already used read-directory-name and deliberately
> used read-file-name in some cases, so there seems to be something more
> going on here.  The comment doesn't explain why we use read-file-name,
> but IIRC there's an issue where we want to let the user enter a glob
> pattern or something like that.
> Can you try and figure out what's really going on here?

My guess is that the code was copied over from the commented out bit
just below, which does have a reason to distinguish the two cases (to
offer completion in the non-graphical case). But on the "simple" version
which is what's actually in the code, I don't see any reason not to use
read-directory-name. But then I could be missing something.

Read-directory-name is basically a wrapper on read-file-name, using
file-directory-p as PREDICATE. So if anything else, read-directory-name
is more restrictive than read-file-name. In any case, since MUSTMATCH
is nil, there's no obligation to choose a real file/directory, so
PREDICATE is only used for completion purposes.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]