]> git.eshelyaron.com Git - emacs.git/commitdiff
Tweak how loaddefs-gen decides whether to do a full update
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 1 Jun 2022 10:55:06 +0000 (12:55 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 1 Jun 2022 10:55:16 +0000 (12:55 +0200)
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Do a
complete build more often to avoid problems with going from old
loaddefs.el files to new ones.

lisp/emacs-lisp/loaddefs-gen.el

index 8dcb55d82d4e81ed6bc7818af53b38b4e3e9bbb8..63b3fd13d7f4b34da033bdf4a9d88424b9e2061c 100644 (file)
@@ -508,6 +508,13 @@ If INCLUDE-PACKAGE-VERSION, include package version data."
                                 (directory-files (expand-file-name d)
                                                   t files-re))
                               (if (consp dir) dir (list dir)))))
+         (updating (and (file-exists-p output-file)
+                        ;; Always do a complete update if loaddefs-gen.el
+                        ;; has been updated and we're doing a base build.
+                        include-package-version
+                        (file-newer-than-file-p
+                         output-file
+                         (expand-file-name "emacs-lisp/loaddefs-gen.el"))))
          (defs nil))
 
     ;; Collect all the autoload data.
@@ -518,7 +525,7 @@ If INCLUDE-PACKAGE-VERSION, include package version data."
           (file-count 0))
       (dolist (file files)
         (progress-reporter-update progress (setq file-count (1+ file-count)))
-        (when (or (not (file-exists-p output-file))
+        (when (or (not updating)
                   (file-newer-than-file-p file output-file))
           (setq defs (nconc
                      (loaddefs-generate--parse-file