* bug#2061: Fwd: Loading .el when newer than .elc [not found] <CAOnWdoinPUXtFKDyhDnFJq1r+tKFSn19EXG1P=55wUf-RPPb7Q@mail.gmail.com> @ 2014-02-11 12:48 ` Reuben Thomas 2014-02-11 16:14 ` Eli Zaretskii 0 siblings, 1 reply; 5+ messages in thread From: Reuben Thomas @ 2014-02-11 12:48 UTC (permalink / raw) To: 2061 [-- Attachment #1: Type: text/plain, Size: 2341 bytes --] I just got annoyed enough about missing a warning that an .el file is newer than an .elc file to want to file a bug report, and sure enough found this issue has already been discussed. To summarize the discussion so far, the following reasons have been advanced for not wanting automatically to prefer a newer .el over an older .elc: 1. One might be working on the .el file, and not want to load it yet. 2. This is a bug, which should be fixed by recompiling the .el. Several workarounds have been proposed for those who want to use the newest version of the .el; they all involve recompiling the file (which some people complained slowed things down too much, and others pointed out could lead to loops when working on a large project), and all involve taking action for specific files, e.g. per-project, or per-file, or per-directory. I think it's worth looking at those objections again in a modern context: 1. We don't work on deployed code any more (or shouldn't!). We use version control systems, we run tests before deploying. When I fiddle with a file, I always want my changes to take effect instantly: either I'm working on code I'm developing, or I'm trying a fix on a deployed file (and am willing to keep the bits if it breaks!). 2. GNU distributions go to some lengths to ensure that all system-installed .el files are compiled and up-to-date. el-get does the same for user-installed packages. There's little else. Meanwhile, the workarounds require almost as much effort to install and maintain as simply remembering to byte-compile everything. Personally, I have wasted hours by thinking I'm loading a new .el when I'm loading an old .elc, plus going through various recompilation dances when I do remember. The time that defaulting to .elc has saved me is minimal, owing to Debian+el-get taking care of recompilation. Hence, could we have a preference that reverses the behavior, i.e. when the .el is newer, it is loaded, and a warning emitted? The default behavior should of course remain the same. It's a simple, uniform, discoverable solution. I'd happily work up a patch myself. The preference could be used in .dir-locals.el by users who preferred to switch it on only for, say, per-user site-lisp directories or project directories. How about: load-el-when-newer (defaults to nil) ? -- http://rrt.sc3d.org [-- Attachment #2: Type: text/html, Size: 2528 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#2061: Fwd: Loading .el when newer than .elc 2014-02-11 12:48 ` bug#2061: Fwd: Loading .el when newer than .elc Reuben Thomas @ 2014-02-11 16:14 ` Eli Zaretskii 2014-02-11 16:37 ` Reuben Thomas 0 siblings, 1 reply; 5+ messages in thread From: Eli Zaretskii @ 2014-02-11 16:14 UTC (permalink / raw) To: Reuben Thomas; +Cc: 2061 > Date: Tue, 11 Feb 2014 12:48:42 +0000 > From: Reuben Thomas <rrt@sc3d.org> > > How about: load-el-when-newer (defaults to nil) ? From etc/NEWS: ** New option `load-prefer-newer' affects how the `load' function chooses the file to load. If this is non-nil, then when both .el and .elc versions of a file exist, and the caller did not explicitly specify which one to load, then the newer file is loaded. The default, nil, means to always load the .elc file. ^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#2061: Fwd: Loading .el when newer than .elc 2014-02-11 16:14 ` Eli Zaretskii @ 2014-02-11 16:37 ` Reuben Thomas 2014-02-11 17:03 ` Glenn Morris 0 siblings, 1 reply; 5+ messages in thread From: Reuben Thomas @ 2014-02-11 16:37 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 2061 [-- Attachment #1: Type: text/plain, Size: 738 bytes --] On 11 February 2014 16:14, Eli Zaretskii <eliz@gnu.org> wrote: > > Date: Tue, 11 Feb 2014 12:48:42 +0000 > > From: Reuben Thomas <rrt@sc3d.org> > > > > How about: load-el-when-newer (defaults to nil) ? > > From etc/NEWS: > > ** New option `load-prefer-newer' affects how the `load' function chooses > the file to load. If this is non-nil, then when both .el and .elc > versions of a file exist, and the caller did not explicitly specify > which one to load, then the newer file is loaded. The default, nil, > means to always load the .elc file. > Joy! I'm sorry my timing was bad, in that I looked into this after it had been committed, but before it had been released. Thanks for the intelligence. -- http://rrt.sc3d.org [-- Attachment #2: Type: text/html, Size: 1244 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#2061: Fwd: Loading .el when newer than .elc 2014-02-11 16:37 ` Reuben Thomas @ 2014-02-11 17:03 ` Glenn Morris 2014-02-11 17:15 ` Reuben Thomas 0 siblings, 1 reply; 5+ messages in thread From: Glenn Morris @ 2014-02-11 17:03 UTC (permalink / raw) To: Reuben Thomas; +Cc: 2061 Reuben Thomas wrote: > Joy! I'm sorry my timing was bad, in that I looked into this after it had > been committed, but before it had been released. That's fine, but why not read the report, especially the close message, before reopening it? http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2061#106 seems clear to me. Now the OP will wonder why his bug was opened and closed again. ^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#2061: Fwd: Loading .el when newer than .elc 2014-02-11 17:03 ` Glenn Morris @ 2014-02-11 17:15 ` Reuben Thomas 0 siblings, 0 replies; 5+ messages in thread From: Reuben Thomas @ 2014-02-11 17:15 UTC (permalink / raw) To: Glenn Morris; +Cc: 2061 [-- Attachment #1: Type: text/plain, Size: 608 bytes --] On 11 February 2014 17:03, Glenn Morris <rgm@gnu.org> wrote: > Reuben Thomas wrote: > > > Joy! I'm sorry my timing was bad, in that I looked into this after it had > > been committed, but before it had been released. > > That's fine, but why not read the report, especially the close message, > before reopening it? > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2061#106 > > seems clear to me. > You're right, it is. However, I read the bug report on the mailing list archive, and didn't find the close message there. The moral is to use the debbugs interface for completeness. -- http://rrt.sc3d.org [-- Attachment #2: Type: text/html, Size: 1120 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-02-11 17:15 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <CAOnWdoinPUXtFKDyhDnFJq1r+tKFSn19EXG1P=55wUf-RPPb7Q@mail.gmail.com> 2014-02-11 12:48 ` bug#2061: Fwd: Loading .el when newer than .elc Reuben Thomas 2014-02-11 16:14 ` Eli Zaretskii 2014-02-11 16:37 ` Reuben Thomas 2014-02-11 17:03 ` Glenn Morris 2014-02-11 17:15 ` Reuben Thomas
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).