unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: bug-gnu-emacs@gnu.org
Subject: 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	[thread overview]
Message-ID: <glp51a$3um$1@ger.gmane.org> (raw)
In-Reply-To: <f7ccd24b0901271806x2f92aaady8e97a4aef6002ccc@mail.gmail.com>

Juanma Barranquero wrote:
> On Tue, Jan 27, 2009 at 16:54, Brent Goodrick <bgoodr@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








  reply	other threads:[~2009-01-28  8:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-26  2:19 bug#2061: 23.0.60; Add preference to force load of Elisp files when they are newer than corresponding byte-compiled file Brent Goodrick
2009-01-26  4:08 ` Eli Zaretskii
2009-01-27 15:08   ` Brent Goodrick
2009-01-26  8:45 ` Juanma Barranquero
2009-01-27 15:54   ` Brent Goodrick
2009-01-28  2:06     ` Juanma Barranquero
2009-01-28  8:29       ` Kevin Rodgers [this message]
2009-02-02 16:07       ` Brent Goodrick
2009-01-26 16:31 ` Richard M Stallman
2009-01-27 15:56   ` Brent Goodrick
  -- strict thread matches above, loose matches on Subject: below --
2009-01-27  0:49 Stefan Monnier
2009-02-02 18:56 ` Juanma Barranquero
2009-02-03  9:59 ` Richard M Stallman
2009-02-03 21:07   ` Stefan Monnier

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='glp51a$3um$1@ger.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=2061@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@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).