]> git.eshelyaron.com Git - emacs.git/commitdiff
Add commentary about #$ in autoload files
authorNoam Postavsky <npostavs@gmail.com>
Sat, 6 Jul 2019 02:26:13 +0000 (22:26 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sat, 6 Jul 2019 18:34:47 +0000 (14:34 -0400)
* lisp/emacs-lisp/autoload.el (autoload-rubric): Add commentary about
`#$' trick.

lisp/emacs-lisp/autoload.el

index 21b8caccf4bcd03c8251ae87fe565d7e3d164a2c..dfcf17ce1e8bf423d2d8acfec17fb71e2c01db4a 100644 (file)
@@ -370,7 +370,11 @@ FILE's name."
            ";;\n"
            ";;; Code:\n\n"
            (if lp
-               ;; `load-path' should contain only directory names.
+                ;; 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")
            "\f\n"
@@ -381,7 +385,7 @@ FILE's name."
                          (file-name-sans-extension basename))))
            ";; Local Variables:\n"
            ";; version-control: never\n"
-           ";; no-byte-compile: t\n"
+            ";; no-byte-compile: t\n" ;; #$ is byte-compiled into nil.
            ";; no-update-autoloads: t\n"
            ";; coding: utf-8\n"
            ";; End:\n"