From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: locate-file in Emacs Date: Wed, 17 Apr 2002 06:01:43 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200204171001.g3HA1hh27230@rum.cs.yale.edu> References: <200204170928.g3H9SVb27019@rum.cs.yale.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1019037806 32176 127.0.0.1 (17 Apr 2002 10:03:26 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 17 Apr 2002 10:03:26 +0000 (UTC) Cc: "Stefan Monnier" , emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16xmHe-0008Mr-00 for ; Wed, 17 Apr 2002 12:03:26 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16xmaH-0006SD-00 for ; Wed, 17 Apr 2002 12:22:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16xmHd-00040i-00; Wed, 17 Apr 2002 06:03:25 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16xmG0-0005d4-00 for ; Wed, 17 Apr 2002 06:01:44 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g3HA1hh27230; Wed, 17 Apr 2002 06:01:43 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Hrvoje Niksic Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2697 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2697 > > 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