emacs-devel
[Top][All Lists]
Advanced

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

Re: locate-library, the NOSUFFIX arg and a [PATCH]


From: MON KEY
Subject: Re: locate-library, the NOSUFFIX arg and a [PATCH]
Date: Fri, 22 Jan 2010 21:10:13 -0500

On Fri, Jan 22, 2010 at 10:18 AM, Stefan Monnier
<address@hidden> wrote:
>>> This is poorly worded but means that it will not only look for files
>>> of the form DIR/FILE.SUFFIX but also for DIR/FILE (i.e. it will add the
>>> empty string as a valid suffix).
>
>> A) It doesn't do that now.
>
> What makes you think so?

Assume I have the files subr, subr.el, and subr.gz in the directory:
/home/mon/fnd-sbr

(locate-library "subr" t '("/home/mon/fnd-sbr"))

That is, I ask locate-library:

``Please find me a library "subr", and while your doing this don't add the
  load-suffixes ".elc" ".el" to "subr", but _do_ match files with the name
  "subr""" if you happen to see those''.

IOW find me anything named "subr" or anything named "subr""".

So, locate-library returns:
=> /home/mon/fnd-sbr/subr

Now, assume I have only subr.el and subr.gz in the same directory.

I make the same request:
(locate-library "subr" t '("/home/mon/fnd-sbr"))

locate-library returns
=> "/home/mon/fnd-sbr/subr.gz"

Now, kindly point out to me the empty string at the end of subr?

Now, assume I have only of subr.el.gz in same directory?
(locate-library "subr" t '("/home/mon/fnd-sbr"))
=> nil

What is the difference between subr.gz and subr.el.gz?

The difference is due to `load-file-rep-suffixes' matching `".gz"'.

>
> I did explain it, tho obvious you didn't understand it.

I understood well enough how you explained it, I just don't buy it.

>
> Again, no, because this argument describes which extensions might be
> added to the provided string in order to find a file name.  None of the
> file name's suffixes are ever removed by locate-library.

Except ".el.gz" right?

>
> [Stopped reading at this point, sorry]

This is unfortunate.
Maybe you can try the patch one day when your not so busy, or the next
time your rootin' through the comments in files like ffap.el e.g. its
`ffap-locate-file'...

>
>        Stefan

/s_P\




reply via email to

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