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: Thu, 18 Apr 2002 10:08:03 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200204181408.g3IE83b02114@rum.cs.yale.edu> References: <200204170928.g3H9SVb27019@rum.cs.yale.edu> <200204171001.g3HA1hh27230@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 1019139018 21655 127.0.0.1 (18 Apr 2002 14:10:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 18 Apr 2002 14:10:18 +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 16yCc6-0005dA-00 for ; Thu, 18 Apr 2002 16:10:18 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16yCvI-0002DZ-00 for ; Thu, 18 Apr 2002 16:30:09 +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 16yCc6-0006bf-00; Thu, 18 Apr 2002 10:10:18 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16yCZx-0006Mh-00 for ; Thu, 18 Apr 2002 10:08:05 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g3IE83b02114; Thu, 18 Apr 2002 10:08:03 -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:2727 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2727 > "Stefan Monnier" writes: > > >> 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 ;-) > > That would break backward compatibility, which is fairly important in I fail to see why: (defun locate-file (f p s predicate) (cond ((memq predicate '(executable writable ...)) ...) ((functionp predicate) nil) ((listp predicate) ...) ...) you should be able to keep backward compatibility just fine. The qusetion is whether or not you find the `predicate' interface preferable. I do because it's more flexible. But I'm biased since it also makes our implementation simpler. Of course, otherwise we can export the `openp' function "raw" (but adding a `predicate' argument) and then implement locate-file's MODE argument in elisp on top of it. I think there's no question that locate-file should exist in Emacs and I thank you for pushing us to implement it. Stefan PS: a grep through XEmacs packages seems to indicate that the MODE argument is rarely used and that the few times it's used it's only to check executablility but uses the integer 1 instead of the `executable' symbol. So assuming that the core code is updated to the new interface, I'm not even sure if `executable', `writable' and friends needs to be supported (although the integer 1 should be). Unless of course I missed something.