GNU bug report logs -
#77502
31.0.50; Should after-load-functions hook report .eln file names?
Previous Next
Reported by: Sean Devlin <spd <at> toadstyle.org>
Date: Thu, 3 Apr 2025 18:36:02 UTC
Severity: normal
Found in version 31.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 77502 <at> debbugs.gnu.org (full text, mbox):
> From: Sean Devlin <spd <at> toadstyle.org>
> Date: Thu, 3 Apr 2025 13:35:19 -0500
>
> Hi folks,
>
> I am not sure if this is a bug or not, but the behavior was confusing to
> me.
>
> Recipe:
>
> 0. If necessary, rebuild Emacs with native compilation support.
> 1. Emacs -Q
> 2. In scratch, evaluate:
>
> (setq force-load-messages t)
> (add-hook 'after-load-functions
> (lambda (file)
> (message "after load: %s" file)))
>
> 3. M-x load-library RET org RET
> 4. C-h e
>
> The messages buffer will show a lot of messages like this:
>
> Loading find-func (native compiled elisp)...
> after load: /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/find-func.elc
> Loading find-func (native compiled elisp)...done
>
> The load messages show that a native library was loaded, but the
> after-load hook reports loading a byte-compiled file.
>
> The documentation for after-load-functions says:
>
> "Each function there is called with a single argument, the absolute name
> of the file just loaded."
>
> I do not understand the intricacies of the native compiler and loader,
> so maybe this behavior is expected. But the result seemed misleading to
> me, and I could not find documentation of the disparity between what
> after-load-functions reports and what is actually loaded.
>
> Is this a bug?
Not sure if this is a bug or a feature. We record the *.elc names in
load-history, and those are the names passed to after-load-functions.
I've added Stefan and Andrea to this discussion, in case they have
comments.
If this is a feature, I guess we should update the documentation.
Thanks.
This bug report was last modified 32 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.