unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Reuben Thomas <rrt@sc3d.org>
To: 2061@debbugs.gnu.org
Subject: bug#2061: Fwd: Loading .el when newer than .elc
Date: Tue, 11 Feb 2014 12:48:42 +0000	[thread overview]
Message-ID: <CAOnWdogOOBT+ttn51c=AYCJErN=cEPZxPCB7Ad0VKzyO5bczQg@mail.gmail.com> (raw)
In-Reply-To: <CAOnWdoinPUXtFKDyhDnFJq1r+tKFSn19EXG1P=55wUf-RPPb7Q@mail.gmail.com>

[-- 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 --]

       reply	other threads:[~2014-02-11 12:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOnWdoinPUXtFKDyhDnFJq1r+tKFSn19EXG1P=55wUf-RPPb7Q@mail.gmail.com>
2014-02-11 12:48 ` Reuben Thomas [this message]
2014-02-11 16:14   ` bug#2061: Fwd: Loading .el when newer than .elc Eli Zaretskii
2014-02-11 16:37     ` Reuben Thomas
2014-02-11 17:03       ` Glenn Morris
2014-02-11 17:15         ` Reuben Thomas

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='CAOnWdogOOBT+ttn51c=AYCJErN=cEPZxPCB7Ad0VKzyO5bczQg@mail.gmail.com' \
    --to=rrt@sc3d.org \
    --cc=2061@debbugs.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).