emacs-devel
[Top][All Lists]
Advanced

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

Re: locate-file in Emacs


From: Hrvoje Niksic
Subject: Re: locate-file in Emacs
Date: Thu, 18 Apr 2002 18:20:29 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Common Lisp, i686-pc-linux)

"Stefan Monnier" <monnier+gnu/address@hidden> writes:

>> > you should be able to keep backward compatibility just fine.
>> > The question is whether or not you find the `predicate' interface
>> > preferable.
>> 
>> I find this "mixing" of interfaces far from elegant, but I'll agree
>> that it's flexible.
>
> I'd of course document the MODE-style arguments as obsolete, so that
> the inelegance is "temporary".

I don't agree with that.  At least, I wouldn't obsolete them for
XEmacs.  I think they're quite useful, and much faster than the
generic PREDICATE.

> I have no doubt that it's been used, so do you happen to know if it
> has been used in packages that are in active use ?

I have no statistics about that.

> Based on the information here, I think I'll go ahead and implement
> the functionality on top of `openp' with just a `predicate' argument
> and without backward compatibility for `mode'.

Please name your function differently to avoid confusion.  I am
beginning to regret bringing this up.

> But I have one question left: should the `file-directory-p' check be enforced
> independently from `predicate' ?

Yes, please.  For several days I ran my `locate-file' in place of
XEmacs's original (to shake out the bugs), and I noticed that
`sh-script' wouldn't load.  That is because my locate-file found
contains "packages/sh-script" (a directory) before
"packages/sh-script/lisp/sh-script[.elc]" (a file).

> I.e. can (locate-file f p s 'file-readable-p) return a directory ?
>
> "Yes" is better since it allows the caller to choose whether
> directories are considered or not but "no" is better because it
> allows (locate-file file path suffixes 'file-executable-p) to behave
> like your current (locate-file file path suffixes 'executable).  Or
> does the current XEmacs code always consider directories anyway ?

I think it is ok for a function named `locate-file' to ignore
directories.



reply via email to

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