]> git.eshelyaron.com Git - emacs.git/commitdiff
(byte-compile-eval): Avoid some false positive "noruntime" warnings
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 11 May 2022 21:17:10 +0000 (17:17 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 11 May 2022 21:17:10 +0000 (17:17 -0400)
* lisp/emacs-lisp/bytecomp.el (byte-compile-eval): Loosen the check
before refraining from adding a function to noruntime.

lisp/emacs-lisp/bytecomp.el

index cbf2659109a232c5192024fe006d0af3bc2826a9..1fef9b00d8545047ed2ee15f0a379d623bb3509c 100644 (file)
@@ -1056,8 +1056,14 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
                (dolist (s xs)
                  (pcase s
                    (`(defun . ,f)
-                    (unless (seq-some #'autoloadp
-                                      (get (cdr s) 'function-history))
+                    ;; If `f' has a history, it's presumably because
+                    ;; it was already defined beforehand (typically
+                    ;; as an autoload).  It could also be because it
+                    ;; was defined twice during `form', in which case
+                    ;; we arguably should add it to b-c-noruntime-functions,
+                     ;; but it's not clear it's worth the trouble
+                    ;; trying to recognize that case.
+                    (unless (get f 'function-history)
                        (push f byte-compile-noruntime-functions)))))))))))))
 
 (defun byte-compile-eval-before-compile (form)