From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>, Drew Adams <drew.adams@oracle.com>
Cc: 20968@debbugs.gnu.org
Subject: bug#20968: 25.0.50; Be able to specify the output directory for `byte-compile-file'
Date: Sat, 4 Jul 2015 07:41:47 -0700 (PDT) [thread overview]
Message-ID: <dc02c2ca-d069-4559-820d-fbd6dfaed9d3@default> (raw)
In-Reply-To: <<83pp48xqm8.fsf@gnu.org>>
> > Why should the target dir be hardwired to the source dir? Testing
> > might be a reason for the enhancement: quickly remove the *.elc
> > dir from `load-path' to take byte-compilation complications out of
> > the equation. Having different compilation dirs for different
> > Emacs versions could be another argument for such flexibility.
> >
> > Is there a compelling reason, beyond "we've always done without
> > this", not to let users specify the output dir?
>
> One reason is to be able to use "M-x load-library RET", and have it
> DTRT. If the *.elc files are separate from *.el, then at best the
> problem of deciding which version to load becomes harder and the
> loading becomes slower, and at worst you'll have a subtle bug on
> your hands. E.g., what if more than one directory on load-path has
> a file that goes by the same name? And in what order do you search
> load-path for the companion .el file, given that you found .elc in
> in some directory?
It can of course happen that someone is confused, doesn't know how
`load-library' works, and doesn't get the behavior that s?he
mistakenly expected.
But AFAIK, the behavior is well-defined. And this was precisely
one of the possible use cases I outlined. Ordering multiple dirs
in `load-path' is a way to control which version of a library gets
loaded (whether .el or .elc gets loaded, and which .el or .elc gets
loaded).
So yes, this gives users more, not less control. And with greater
control comes more possibilities to shoot oneself in the foot.
(The control is not strictly greater than now, of course, since
even now you can move .elc and .el files to whatever dirs you like.
All the suggested enhancement does is facilitate separation of .el
and .elc, letting you do that at compilation time.)
So unless I'm missing something, I see no good argument against
the suggestion when it comes to `load-library'.
> Last, but not least: the current implementation of loading a Lisp
> file is a 2-level loop, where the outer one loops over the
> directories, and the inner one over the suffixes.
Which means that if there is only one suffix in a given directory
then the inner one becomes a trivial case, no?
> So this suggestion, if implemented, will need C-level changes as well.
I trust your estimation of that, but I don't understand why it
would be the case. Can you give a concrete example showing why
separate dirs with .el and .elc would not be handled today?
next prev parent reply other threads:[~2015-07-04 14:41 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <<23829743-922e-4304-8ab3-b762b8193860@default>
[not found] ` <<74y4iytdjg.fsf@fencepost.gnu.org>
[not found] ` <<e68f1dc9-9e8f-4f54-af8f-a5bb23160576@default>
[not found] ` <<83pp49zb03.fsf@gnu.org>
2015-07-03 14:55 ` bug#20968: 25.0.50; Be able to specify the output directory for `byte-compile-file' Drew Adams
2015-07-04 8:40 ` Eli Zaretskii
2015-07-04 18:48 ` Stefan Monnier
[not found] ` <<d5d5b826-847c-41be-9392-25446b6e37fa@default>
[not found] ` <<83pp48xqm8.fsf@gnu.org>
2015-07-04 14:41 ` Drew Adams [this message]
2015-07-04 16:42 ` Eli Zaretskii
[not found] <<dc02c2ca-d069-4559-820d-fbd6dfaed9d3@default>
[not found] ` <<83615zyiuq.fsf@gnu.org>
2015-07-04 18:20 ` Drew Adams
2015-07-04 18:25 ` Eli Zaretskii
[not found] ` <<f766b63c-edb1-4f11-9f14-bfcd95d8adcd@default>
[not found] ` <<831tgnye3x.fsf@gnu.org>
2015-07-04 18:54 ` Drew Adams
2015-07-02 21:05 Drew Adams
2015-07-02 22:12 ` Glenn Morris
2015-07-02 23:51 ` Drew Adams
2015-07-03 12:22 ` Eli Zaretskii
2015-07-03 15:10 ` Stefan Monnier
2015-07-03 17:12 ` Glenn Morris
2015-07-03 17:27 ` Glenn Morris
2015-07-03 17:49 ` Eli Zaretskii
2015-07-03 22:48 ` Artur Malabarba
2015-07-04 8:24 ` Eli Zaretskii
2015-07-04 10:38 ` Alexis
2015-07-04 11:55 ` Eli Zaretskii
2015-07-04 11:10 ` Artur Malabarba
2015-07-04 11:56 ` Eli Zaretskii
2015-07-04 18:46 ` Stefan Monnier
2015-07-04 18:55 ` Eli Zaretskii
2015-07-04 19:26 ` Stefan Monnier
2015-07-04 19:31 ` Eli Zaretskii
2015-07-05 11:54 ` Dmitry Gutov
2015-07-05 14:35 ` Eli Zaretskii
2015-07-05 14:54 ` Dmitry Gutov
2015-07-05 15:18 ` Eli Zaretskii
2015-07-05 15:54 ` Artur Malabarba
2015-07-05 21:56 ` Richard Stallman
2016-04-30 20:07 ` Lars Ingebrigtsen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dc02c2ca-d069-4559-820d-fbd6dfaed9d3@default \
--to=drew.adams@oracle.com \
--cc=20968@debbugs.gnu.org \
--cc=eliz@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).