GNU bug report logs - #40636
[PATCH] Fix `eval-after-load' hooks not running on eln files.

Previous Next

Package: emacs;

Reported by: Andrew Whatson <whatson <at> gmail.com>

Date: Wed, 15 Apr 2020 05:31:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrew Whatson <whatson <at> gmail.com>
To: 40636 <at> debbugs.gnu.org
Cc: Andrew Whatson <whatson <at> gmail.com>
Subject: bug#40636: [PATCH] Fix `eval-after-load' hooks not running on eln files.
Date: Wed, 15 Apr 2020 13:59:25 +1000
After loading, `do-after-load-evaluation' is called with "the absolute
true name of a file just loaded".  The `eval-after-load-helper' hook was
comparing this with `load-file-name' containing the mangled file name,
so never running.

* lisp/subr.el (eval-after-load): Compare against `load-true-file-name'
  to properly detect the loading of native-compiled files.
---
 lisp/subr.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index f7445d8c25..def2d9b184 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4603,7 +4603,7 @@ eval-after-load
                  (if (not load-file-name)
                      ;; Not being provided from a file, run func right now.
                      (funcall func)
-                   (let ((lfn load-file-name)
+                   (let ((lfn load-true-file-name)
                          ;; Don't use letrec, because equal (in
                          ;; add/remove-hook) would get trapped in a cycle.
                          (fun (make-symbol "eval-after-load-helper")))
-- 
2.26.1





This bug report was last modified 5 years and 8 days ago.

Previous Next


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