unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Whatson <whatson@gmail.com>
To: 40636@debbugs.gnu.org
Cc: Andrew Whatson <whatson@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	[thread overview]
Message-ID: <20200415035925.1923378-1-whatson@gmail.com> (raw)

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






             reply	other threads:[~2020-04-15  3:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15  3:59 Andrew Whatson [this message]
2020-08-08 12:53 ` bug#40636: [PATCH] Fix `eval-after-load' hooks not running on eln files Lars Ingebrigtsen

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=20200415035925.1923378-1-whatson@gmail.com \
    --to=whatson@gmail.com \
    --cc=40636@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).