Subject: Re: bug#78995: [PATCH] ;;;autoload-expand for special macros

From: Michael Albinus <[email-masked]>
Date: Wed, 30 Jul 2025 10:00:00 +0200

"J.D. Smith" <[email-masked]> writes:

Hi,

> Good idea.  Michael, if you can try this along with a patch like the one
> Stefan proposed for tramp (correcting the declare form name) that would
> be useful.  Assuming it all works as expected, you'll notice
> `tramp-loaddefs.el' no longer contains the macro and the calls to it,
> but rather only the expanded forms it generates.

Before doing so, I've tried Stefan's patch with Emacs 28. There are
compilation warnings.

--8<---------------cut here---------------start------------->8---
# gmake -C lisp distclean ; gmake -C lisp EMACS=/usr/local/src/emacs-28/src/emacs
gmake: Entering directory '/home/albinus/src/tramp/lisp'
rm -f .\#* \#* .*~ *~ *.aux *.cp *.cps *.diff *.dvi *.elc *.fn *.fns *.html *.info *.ky *.kys *.log *.pdf *.pg *.tmp *.toc *.tp *.vr *.vrs
rm -f tramp-loaddefs.el
gmake: Leaving directory '/home/albinus/src/tramp/lisp'
gmake: Entering directory '/home/albinus/src/tramp/lisp'
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l autoload						    \
  --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \
  --eval "(setq generated-autoload-file				    \
	    (expand-file-name \"tramp-loaddefs.el\"))"		    \
  --eval "(setq make-backup-files nil)"				    \
  -f batch-update-autoloads .
  SCRAPE   .
  INFO     Scraping files for tramp-loaddefs.el... 
  INFO     Scraping files for tramp-loaddefs.el...done
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-loaddefs.el
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile trampver.el
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-compat.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup

In toplevel form:
tramp.el:109:50: Warning: Unknown macro property autoload-macro in
    tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-adb.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-androidsu.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-cache.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-cmds.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-container.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-crypt.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-ftp.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-fuse.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-integration.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-message.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-rclone.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-sh.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-smb.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-sshfs.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-sudoedit.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-uu.el
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-archive.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
/usr/local/src/emacs-28/src/emacs -Q -batch -L /home/albinus/src/tramp/lisp -l bytecomp -f batch-byte-compile tramp-gvfs.el
tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
gmake: Leaving directory '/home/albinus/src/tramp/lisp'
--8<---------------cut here---------------end--------------->8---

And also at runtime.

--8<---------------cut here---------------start------------->8---
# /usr/local/src/emacs-28/src/emacs -Q -L /home/albinus/src/tramp/lisp /ssh::
For information about GNU Emacs and the GNU system, type C-h C-a.
../home/albinus/src/tramp/lisp/tramp-loaddefs.el: Warning: Unknown macro property autoload-macro in tramp--with-startup
Waiting for git... [2 times]
Tramp: Opening connection for gandalf using ssh...done
Tramp: Setup connection for gandalf using ssh...done
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.