From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <18813.7599.138907.415045@hungover.brentg.com> <18815.11809.968195.804775@hungover.brentg.com> Reply-To: Kevin Rodgers , 2061@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1233132239 6564 80.91.229.12 (28 Jan 2009 08:43:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Jan 2009 08:43:59 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 28 09:45:13 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LS62q-00086x-2T for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Jan 2009 09:45:12 +0100 Original-Received: from localhost ([127.0.0.1]:58762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LS61Y-00017L-EG for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Jan 2009 03:43:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LS61H-0000z7-Nf for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 03:43:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LS61F-0000y4-Hn for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 03:43:34 -0500 Original-Received: from [199.232.76.173] (port=46999 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LS61F-0000y1-9h for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 03:43:33 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47161) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LS61E-0000La-DN for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 03:43:32 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0S8hTan021904; Wed, 28 Jan 2009 00:43:30 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0S8Z27m019577; Wed, 28 Jan 2009 00:35:02 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kevin Rodgers Original-Sender: news Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 28 Jan 2009 08:35:02 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2061 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123313139318346 (code B ref -1); Wed, 28 Jan 2009 08:35:02 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 28 Jan 2009 08:29:53 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0S8TlWa018328 for ; Wed, 28 Jan 2009 00:29:50 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LS5nv-0006Yl-LT for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 03:29:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LS5nt-0006XE-Vi for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 03:29:47 -0500 Original-Received: from [199.232.76.173] (port=45137 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LS5nt-0006X8-OK for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 03:29:45 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:41077 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LS5nt-0006xL-24 for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 03:29:45 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LS5nm-0007hF-TH for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 08:29:38 +0000 Original-Received: from c-67-161-145-183.hsd1.co.comcast.net ([67.161.145.183]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Jan 2009 08:29:38 +0000 Original-Received: from kevin.d.rodgers by c-67-161-145-183.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Jan 2009 08:29:38 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-67-161-145-183.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Wed, 28 Jan 2009 03:43:34 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:24672 Archived-At: Juanma Barranquero wrote: > On Tue, Jan 27, 2009 at 16:54, Brent Goodrick 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