Subject: Re: bug#53024: 29.0.50; Wishlist: Byte-compile loaddefs.el?

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 22 Jan 2022 13:27:08 +0100

Lars Ingebrigtsen <[email-masked]> writes:

> Parts of 59732a83c8 (removing DOC file scanning for .el files) were
> reverted because of loaddefs.el handling (see bug#52969).  Stefan M
> suggested the possibility of re-reverting that, but that would mean that
> loaddefs.el would have to be byte-compiled, and it's unclear whether
> that would lead to problems or not.

Hm...  the commment in autoload.el is:

            ";; no-byte-compile: t\n" ;; #$ is byte-compiled into nil.

commit 1f7b602f843d82d2da46528c6cc2a16c794ca668
Author:     Noam Postavsky <[email-masked]>
AuthorDate: Fri Jul 5 22:26:13 2019 -0400

    Add commentary about #$ in autoload files
    
    * lisp/emacs-lisp/autoload.el (autoload-rubric): Add commentary about
    `#$' trick.

Oh, it refers to this:

+                ;; Use the `#$' to indicate current file, from which
+                ;; we extract the directory name.  Note that
+                ;; `package-quickstart-refresh' specifically replaces
+                ;; `#$', so any other tricks (e.g., `load-file-name')
+                ;; will not work for that case.
 		"(add-to-list 'load-path (directory-file-name
                          (or (file-name-directory #$) (car load-path))))\n\n")

Hm.  Anyway, when if I remove the no-byte-compile, then the build does
indeed break:

In toplevel form:
net/tramp-rclone.el:38:2: Error: Symbol’s value as variable is void: tramp-methods
make[3]: *** [Makefile:327: net/tramp-rclone.elc] Error 1
make[3]: *** Waiting for unfinished jobs....

In toplevel form:
net/tramp-sh.el:35:2: Error: Symbol’s value as variable is void: tramp-methods
make[3]: *** [Makefile:327: net/tramp-sh.elc] Error 1

In toplevel form:
net/tramp-smb.el:31:2: Error: Symbol’s value as variable is void: tramp-methods
make[3]: *** [Makefile:327: net/tramp-smb.elc] Error 1

In toplevel form:
net/tramp-sshfs.el:36:2: Error: Symbol’s value as variable is void: tramp-methods
make[3]: *** [Makefile:327: net/tramp-sshfs.elc] Error 1

In toplevel form:
net/tramp-sudoedit.el:37:2: Error: Symbol’s value as variable is void: tramp-methods

This is the simple patch I applied to test.

diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index d0bf342b84..58df936dd9 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -408,7 +408,6 @@ autoload-rubric
 			  (file-name-sans-extension basename))))
 	    ";; Local Variables:\n"
 	    ";; version-control: never\n"
-            ";; no-byte-compile: t\n" ;; #$ is byte-compiled into nil.
 	    ";; no-update-autoloads: t\n"
 	    ";; coding: utf-8-emacs-unix\n"
 	    ";; End:\n"

I haven't tried debugging further, but it looks like it'll take some
work to get this er working.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no