diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-05-11 17:17:10 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-05-11 17:17:10 -0400 |
commit | ed0b589480a1e0a20364e1349fa8fa957ecb1efc (patch) | |
tree | ea337081122b9da5cda46bb4aa5b3f4d10d4d945 /lisp/emacs-lisp | |
parent | f0e08e49145b3602fb73390217f94a6a79a5d632 (diff) | |
download | emacs-ed0b589480a1e0a20364e1349fa8fa957ecb1efc.tar.gz emacs-ed0b589480a1e0a20364e1349fa8fa957ecb1efc.tar.bz2 emacs-ed0b589480a1e0a20364e1349fa8fa957ecb1efc.zip |
(byte-compile-eval): Avoid some false positive "noruntime" warnings
* lisp/emacs-lisp/bytecomp.el (byte-compile-eval): Loosen the check
before refraining from adding a function to noruntime.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index cbf2659109a..1fef9b00d85 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -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) |