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


Message #67 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#2061: 23.0.60;   Add preference to force load of Elisp files
 when they are newer   than corresponding byte-compiled file
Date: Wed, 28 Jan 2009 01:29:37 -0700
Juanma Barranquero wrote:
> On Tue, Jan 27, 2009 at 16:54, Brent Goodrick <bgoodr <at> gmail.com> wrote:
...
>> Add the following logic to the C `load' function:
>>
>>  Before loading either the .el or .elc file, test for the condition
>>  where the .el file is newer than the .elc file. If it is, then do
>>  the following:
>>
>>    See if the `load-hook-stale-byte-compile-handlers' hook variable
>>    is set to non-nil. When it is non-nil, run the hook variable with
>>    `run-hook-with-args-until-success'. Each function the user has
>>    added to that hook variable would do any logic s/he wishes,
>>    including in my case to popup a minibuffer prompt asking what to
>>    do. When the hook function thus called returns a 'prefer-el-file
>>    symbol, `load' then loads the .el file and ignores the .elc
>>    file. Likewise, when the hook function returns the
>>    'prefer-elc-file symbol, then load the .elc file but give no
>>    warning message and ignore the .el file. When nil is returned from
>>    the `run-hook-with-args-until-success' function, just load the
>>    .elc file and produce the stale file warning message as is done
>>    today (i.e., preserve existing behavior).
> 
> That would work, but it is IMHO too much (interface, not code)
> complexity for little gain. In most cases, having a .elc older than
> its corresponding .el is a bug (or, let's call it, a temporary
> situation), so getting a warning to remind the user about fixing it
> seems much more economical.
> 
> That said, sometimes I would've liked to have a hook that runs when a
> file is loaded; or the ability to defadvice Fload (you can, except
> that Fload is also called from C code, for example for autoloads).

Yes, before-load-hook and after-load-hook would be generally useful
if load-file-name were set to load's FILE argument when they're run.

-- 
Kevin Rodgers
Denver, Colorado, USA






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

Previous Next


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