GNU bug report logs - #2061
23.0.60; Add preference to force load of Elisp files when they are newer than corresponding byte-compiled file

Previous Next

Package: emacs;

Reported by: Brent Goodrick <bgoodr <at> gmail.com>

Date: Mon, 26 Jan 2009 02:25:04 UTC

Severity: wishlist

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Reuben Thomas <rrt <at> sc3d.org>
To: 2061 <at> debbugs.gnu.org
Subject: bug#2061: Fwd: Loading .el when newer than .elc
Date: Tue, 11 Feb 2014 12:48:42 +0000
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]

This bug report was last modified 11 years and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.