emacs-devel
[Top][All Lists]
Advanced

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

Re: Reading directory names with read-file-name


From: Stefan Monnier
Subject: Re: Reading directory names with read-file-name
Date: Thu, 23 May 2002 17:24:26 -0400

> >     I've looked some more on this, and the file-name-handlers (e.g.  used
> >     by ange-ftp) further complicates chaning the API for read-file-name,
> >     read-file-name-internal, and file-name-all-completions, as well as
> >     introducting a read-directory-name function.
> > 
> > How so?
> 
> My concern is that existing file-name-handlers for read-file-name
> are written to match the current API for that function, and
> they are expected to "mirror" the behaviour of read-file-name
> for any given set of arguments.
> 
> Now, if we change the API for read-file-name, e.g. by changing
> the interpretation of the MUSTMATCH argument or adding a PREDICATE
> argument, the existing file-name-handlers may no longer work correctly.
> 
> And if I add a new read-directory-name function, the existing
> file-name-handler for read-file-name will not be called when reading a
> directory name; instead a new file-name-handler will be needed for
> read-directory-name (which is simple), but the existing packages which
> install file-name-handlers for read-file-name will need to be extended
> with a file-name-handler for read-directory-name as well.
> 
> So it's not trivial to change the API...

I must say that the ange-ftp code confuses me:
it creates a function ange-ftp-real-read-file-name-internal
which it doesn't use.  It also announces ange-ftp-read-file-name-internal
as the handler for read-file-name-internal but never defines the
function and all this while read-file-name-internal does not check
file-name-handlers (and neither does read-file-name).

So I believe that your fear is just based on some left-over, unused
and incomplete code in ange-ftp.el but is otherwise unfounded.


        Stefan




reply via email to

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