From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Hrvoje Niksic Newsgroups: gmane.emacs.devel Subject: Re: locate-file in Emacs Date: Thu, 18 Apr 2002 18:20:29 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: References: <200204170928.g3H9SVb27019@rum.cs.yale.edu> <200204171001.g3HA1hh27230@rum.cs.yale.edu> <200204181408.g3IE83b02114@rum.cs.yale.edu> <200204181527.g3IFRFC02843@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 1019147081 7725 127.0.0.1 (18 Apr 2002 16:24:41 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 18 Apr 2002 16:24:41 +0000 (UTC) Cc: 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 16yEi9-00020U-00 for ; Thu, 18 Apr 2002 18:24:41 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16yF1O-0005Cx-00 for ; Thu, 18 Apr 2002 18:44:34 +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 16yEer-0004Kr-00; Thu, 18 Apr 2002 12:21:17 -0400 Original-Received: from dragon.arsdigita.de ([212.84.246.66] helo=florida.arsdigita.de) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16yEe7-0004DS-00 for ; Thu, 18 Apr 2002 12:20:31 -0400 Original-Received: from hniksic by florida.arsdigita.de with local (Exim 3.35 #1 (Debian)) id 16yEe5-0006zy-00; Thu, 18 Apr 2002 18:20:29 +0200 Original-To: "Stefan Monnier" X-Attribution: Hrvoje X-Face: &{dT~)Pu6V<0y?>3p$;@vh\`C7xB~A0T-J%Og)J,@-1%q6Q+, gs<-9M#&`I8cJp2b1{vPE|~+JE+gx;a7%BG{}nY^ehK1"q#rG O,Rn1A_Cy%t]V=Brv7h ("Stefan Monnier"'s message of "Thu, 18 Apr 2002 11:27:15 -0400") Original-Lines: 47 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Common Lisp, i686-pc-linux) 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:2737 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2737 "Stefan Monnier" 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.