emacs-devel
[Top][All Lists]
Advanced

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

Re: locate-file in Emacs


From: Stefan Monnier
Subject: Re: locate-file in Emacs
Date: Wed, 17 Apr 2002 06:01:43 -0400

> > This is obviously very convenient.  It should ideally be implemented
> > on top of the `openp' function, such as the quick-hack
> > implementation below.
> 
> It ignores a part of the interface -- the MODE argument in this case.
> My version may not be as optimized, but at least it implements all of
> the interface.  You might want to start by including (and advertising)
> it, and replacing it with an optimized version if it gets used.

Yes, I understand that.  I'm interested in figuring out whether this
interface is really what we want to advertise.

> PREDICATE might make sense, but I don't remember needing it in
> practice.  Plus, it'd change the interface and hence undermine the
> whole point of sharing the function.

Well, I was wondering if it was possible to get XEmacs to adopt it
as well ;-)

> Note that MODE is actually quite easy to implement -- just add a MODE
> option to openp(), and have it call access() instead of open() when
> MODE is provided.  Before doing anything else, decode MODE from Lisp

Sure.  But you also need to add the implementation of `access'
on top of magic-file-handlers, ...
Whereas PREDICATE would just be a 2 liner.

I like code to stay simple and short, and it's even better if it's
flexible, so I really like the PREDICATE argument much better.

I think that if XEmacs agrees that MODE should really be PREDICATE
(it's pretty easy to support both types of args at the same time),
the "eventual compatibility" we'd then get should be "good enough".


        Stefan




reply via email to

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