From: Alex Kosorukoff <alex@3form.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 17467 <17467@debbugs.gnu.org>
Subject: bug#17467: 24.3; locate-library returning spurious path
Date: Sun, 11 May 2014 17:20:23 -0700 [thread overview]
Message-ID: <CAHD9_tTMPFAK1P=4v-z9ZHdKjxFz8ZJV9OcHRszn6UcPHcPm1g@mail.gmail.com> (raw)
In-Reply-To: <jwvppjk3s3p.fsf-monnier+emacsbugs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]
On Sun, May 11, 2014 at 2:56 PM, Stefan Monnier <monnier@iro.umontreal.ca>wrote:
> > The issue is that locate-library returns spurious paths like ".*/tramp"
> or
> > ".*xxx/tramp.gz"
>
> I don't see why these are necessarily spurious. Please give very
> concrete examples, so as to make it crystal clear why they're spurious.
>
I think these file names are more appropriate for data files, not
executable ones. It is undesirable that a name "tramp.gz" will shadow a
valid library file "tramp.elc" that won't be found as a result. When you
say those names aren't spurious, do you have a particular example of an
emacs elisp library in mind which file name ends with a suffix other than
.el .elc .el.gz .elc.gz? I think the main difference is that I assume that
this list is exhaustive and you imply that it is not. You can prove me
wrong by a single example.
> This is both unexpected and incorrect given this function name and
> > spec.
>
> Unexpected to you, obviously, but I'm not convinced it's unexpected in
> general (after all, I don't remember other bug-reports in this area) and
> definitely not incorrect. See the docstring of `load':
>
> Execute a file of Lisp code named FILE.
> First try FILE with `.elc' appended, then try with `.el',
> then try FILE unmodified (the exact suffixes in the exact order are
> determined by `load-suffixes'). Environment variable references in
> [...]
>
By incorrect, I only meant that the function fails to do what its name
suggests when it returns something other than a library. My understanding
is that load is used to load any files, not just libraries.
> Of course, there's an ambiguity about how the search is performed,
> w.r.t. to whether it does:
>
> (dolist (s suffixes) (dolist (d load-path) ...)))
> or
> (dolist (d load-path) (dolist (s suffixes) ...)))
>
> We do the second, so that a compiled file in a later directory does not
> override a non-compiled file in an earlier directory.
>
Yes, I noticed that require won't attempt to load files like "trump" or
"trump.gz" even if they are in the load-path, unlike load that will try to
load any file regardless of its suffix. My understanding was that require
is used to load libraries, while load is used to load general files.
>
> Stefan
>
[-- Attachment #2: Type: text/html, Size: 3412 bytes --]
next prev parent reply other threads:[~2014-05-12 0:20 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-11 16:06 bug#17467: 24.3; locate-library returning spurious path Alex Kosorukoff
2014-05-11 17:03 ` Eli Zaretskii
2014-05-11 17:38 ` Alex Kosorukoff
2014-05-11 17:46 ` Eli Zaretskii
2014-05-11 17:53 ` Alex Kosorukoff
2014-05-11 18:10 ` Eli Zaretskii
2014-05-11 18:55 ` Alex Kosorukoff
2014-05-11 22:55 ` Stefan Monnier
2014-05-12 0:41 ` Alex Kosorukoff
2014-05-11 17:37 ` Glenn Morris
2014-05-11 17:43 ` Alex Kosorukoff
2014-05-11 19:50 ` Stefan Monnier
2014-05-11 20:45 ` Alex Kosorukoff
2014-05-11 21:00 ` Alex Kosorukoff
2014-05-11 21:19 ` Glenn Morris
2014-05-11 22:31 ` Alex Kosorukoff
2014-05-11 21:56 ` Stefan Monnier
2014-05-12 0:20 ` Alex Kosorukoff [this message]
2014-05-12 0:32 ` Glenn Morris
2014-05-12 1:35 ` Alex Kosorukoff
2014-05-12 2:02 ` Alex Kosorukoff
2014-05-12 2:18 ` Stefan Monnier
2014-05-12 4:36 ` Alex Kosorukoff
2014-05-12 6:39 ` Stefan Monnier
2014-05-12 17:46 ` Alex Kosorukoff
2020-08-25 10:39 ` Lars Ingebrigtsen
2020-08-25 14:22 ` Stefan Monnier
2020-08-25 14:25 ` Lars Ingebrigtsen
2020-10-13 1:41 ` Lars Ingebrigtsen
2014-05-15 19:39 ` Stefan Monnier
2014-05-15 23:57 ` Alex Kosorukoff
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='CAHD9_tTMPFAK1P=4v-z9ZHdKjxFz8ZJV9OcHRszn6UcPHcPm1g@mail.gmail.com' \
--to=alex@3form.com \
--cc=17467@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.