GNU bug report logs - #77502
31.0.50; Should after-load-functions hook report .eln file names?

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Sean Devlin <spd <at> toadstyle.org>
Subject: bug#77502: closed (Re: bug#77502: 31.0.50; Should after-load-functions
 hook report .eln file names?)
Date: Sat, 19 Apr 2025 13:55:09 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#77502: 31.0.50; Should after-load-functions hook report .eln file names?

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 77502 <at> debbugs.gnu.org.

-- 
77502: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77502
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean Devlin <spd <at> toadstyle.org>
Cc: acorallo <at> gnu.org, monnier <at> iro.umontreal.ca, 77502-done <at> debbugs.gnu.org
Subject: Re: bug#77502: 31.0.50;
 Should after-load-functions hook report .eln file names?
Date: Sat, 19 Apr 2025 16:54:13 +0300
> From: Sean Devlin <spd <at> toadstyle.org>
> Date: Sat, 5 Apr 2025 11:31:19 -0500
> Cc: Eli Zaretskii <eliz <at> gnu.org>, Andrea Corallo <acorallo <at> gnu.org>,
>  77502 <at> debbugs.gnu.org
> 
> Hi folks,
> 
> > On Apr 5, 2025, at 10:07 AM, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
> > 
> > 
> >> 
> >> 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.
> > 
> > It was done on purpose, at least for backward compatibility reasons, but
> > also because it's easier to find the `.eln` from the `.elc` than
> > the reverse.
> 
> I see, thanks.
> 
> In my case, I don’t necessarily even care about getting the .eln paths in the after-load-functions hook. I just got confused by the results and thought maybe my native loader was not working correctly due to some misconfiguration on my end. In other words, I have no problem with the current behavior, but I do think maybe we should update the documentation somewhere to describe how the hook behaves when the native loader is enabled.
> 
> Cheers.

No further comments, so I'm now closing this bug.

[Message part 3 (message/rfc822, inline)]
From: Sean Devlin <spd <at> toadstyle.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Should after-load-functions hook report .eln file names?
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?

Cheers, and thanks for your help!

In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.4.0, NS
appkit-2575.50 Version 15.4 (Build 24E5238a)) of 2025-03-24 built on
beatrix.local
Repository revision: 068fa2ebf9351711ef15c6fdc3d83f2487bec8e2
Repository branch: spd-igc
Windowing system distributor 'Apple', version 10.3.2575
System Description:  macOS 15.4

Configured using:
'configure --with-ns --with-modules --with-native-compilation
--with-libgmp --with-tree-sitter --with-sqlite3 --with-mps=yes
--without-imagemagick --without-dbus CPPFLAGS=-I/opt/homebrew/include
LDFLAGS=-L/opt/homebrew/lib
PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig'

Configured features:
ACL GIF GMP GNUTLS JPEG LCMS2 LIBXML2 MODULES MPS NATIVE_COMP NOTIFY
KQUEUE NS PDUMPER PNG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug lisp-mnt message mailcap yank-media puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils misearch multi-isearch compile
text-property-search comp-run bytecomp byte-compile comp-common org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src sh-script smie
treesit executable ob-comint org-pcomplete pcomplete comint ansi-osc
ansi-color ring org-list org-footnote org-faces org-entities time-date
subr-x noutline outline icons ob-emacs-lisp ob-core ob-eval org-cycle
org-table ol rx org-fold org-fold-core org-keys oc org-loaddefs cal-menu
calendar cal-loaddefs org-version org-compat org-macs format-spec
cl-loaddefs cl-lib thingatpt find-func rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads kqueue cocoa ns lcms2 multi-tty make-network-process
tty-child-frames native-compile mps emacs)

Memory information:
((conses 24 0 0) (symbols 56 0 0) (strings 40 0 0) (string-bytes 1 0)
(vectors 24 0) (vector-slots 8 0 0) (floats 24 0 0)
(intervals 64 0 0) (buffers 1000 0))



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.