all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hrvoje Niksic <hniksic@arsdigita.com>
Cc: emacs-devel@gnu.org
Subject: Re: locate-file in Emacs
Date: Thu, 18 Apr 2002 18:20:29 +0200	[thread overview]
Message-ID: <sxsofgh9dwy.fsf@florida.arsdigita.de> (raw)
In-Reply-To: <200204181527.g3IFRFC02843@rum.cs.yale.edu> ("Stefan Monnier"'s message of "Thu, 18 Apr 2002 11:27:15 -0400")

"Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> 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	other threads:[~2002-04-18 16:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-17  5:05 locate-file in Emacs Hrvoje Niksic
2002-04-17  5:47 ` Eli Zaretskii
2002-04-17  8:53   ` Hrvoje Niksic
2002-04-17  9:28 ` Stefan Monnier
2002-04-17  9:47   ` Hrvoje Niksic
2002-04-17 10:01     ` Stefan Monnier
2002-04-18 13:16       ` Hrvoje Niksic
2002-04-18 13:54         ` Miles Bader
2002-04-18 14:09           ` Hrvoje Niksic
2002-04-18 14:25             ` Miles Bader
2002-04-18 14:08         ` Stefan Monnier
2002-04-18 15:11           ` Hrvoje Niksic
2002-04-18 15:27             ` Stefan Monnier
2002-04-18 16:20               ` Hrvoje Niksic [this message]
2002-04-18 18:59                 ` Stefan Monnier
2002-04-25 12:12                   ` Hrvoje Niksic
2002-04-25 22:52                     ` Stefan Monnier
2002-05-06 15:58                       ` Hrvoje Niksic
     [not found]                         ` <200205061655.g46Gt3K01382@rum.cs.yale.edu>
2002-05-06 19:53                           ` Hrvoje Niksic
     [not found]                             ` <200205062052.g46KqwO02482@rum.cs.yale.edu>
2002-05-06 20:59                               ` Hrvoje Niksic
2002-05-06 21:12                                 ` Stefan Monnier
2002-05-06 21:57                                   ` Hrvoje Niksic
2002-05-07 20:06                                     ` Richard Stallman
2002-04-18 16:39               ` Eli Zaretskii
2002-04-18 16:24                 ` Hrvoje Niksic
2002-04-19  5:25               ` Richard Stallman
2002-04-18 15:31             ` Miles Bader
2002-04-18 16:29               ` Hrvoje Niksic
2002-04-18 16:45                 ` Miles Bader
2002-04-18 16:49                   ` Hrvoje Niksic
2002-04-18 16:54                     ` Miles Bader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sxsofgh9dwy.fsf@florida.arsdigita.de \
    --to=hniksic@arsdigita.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.