From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: MON KEY <monkey@sandpframing.com>
Cc: emacs-devel@gnu.org
Subject: Re: locate-library, the NOSUFFIX arg and a [PATCH]
Date: Thu, 21 Jan 2010 09:08:10 -0500 [thread overview]
Message-ID: <jwv3a1zo8zx.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <d2afcfda1001191428tb49e131s57a66e4cf0064812@mail.gmail.com> (MON KEY's message of "Tue, 19 Jan 2010 17:28:37 -0500")
> ,----
> | It can omit the suffix (a.k.a. file-name extension) if NOSUFFIX is
> | nil (which is the default, see below).
> `----
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).
> I don't think the docstring even reflects the intent of locate-library's
> NOSUFFIX arg esp. as it doesn't appear to be _able_ to return a library name
> sans extension when not called-interactively.
Indeed, this arg only controls how the search is performed, not in which
form the result will be returned.
> (locate-file-completion-table load-path '("") "subr" #'(lambda (y)
> (string-match-p ".*z" y)) 'nil)
^^^^^^^^^^^^^^^^^^^^^^^^
aka (string-match "z" y)
> => "subr.el.gz"
Looks right to me.
> (let (nosuffix)
> (append (unless nosuffix (get-load-suffixes))
> load-file-rep-suffixes))
> => (".elc" ".elc.gz" ".el" ".el.gz" "" ".gz")
> (let ((nosuffix t))
> (append (unless nosuffix (get-load-suffixes))
> load-file-rep-suffixes))
> => ("" ".gz")
All looks as expected.
> "When called from a program and NOSUFFIX is a boolean, string, or list of
> strings, return LIBRARY's file-truename as if by `file-name-sans-extension'."
That completely changes the meaning of this argument. Why don't you
call file-name-sans-extension outside of locate-library instead, if you
want that?
Stefan
next prev parent reply other threads:[~2010-01-21 14:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-19 22:28 locate-library, the NOSUFFIX arg and a [PATCH] MON KEY
2010-01-21 14:08 ` Stefan Monnier [this message]
2010-01-21 23:58 ` MON KEY
2010-01-22 15:18 ` Stefan Monnier
2010-01-23 2:10 ` MON KEY
2010-01-23 11:23 ` Stefan Monnier
2010-01-24 1:39 ` MON KEY
2010-01-25 3:23 ` Stefan Monnier
2010-01-27 4:25 ` MON KEY
2010-01-27 14:55 ` Stefan Monnier
2010-01-28 1:09 ` MON KEY
2010-01-28 2:46 ` Stefan Monnier
2010-01-29 2:55 ` MON KEY
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=jwv3a1zo8zx.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=monkey@sandpframing.com \
/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.