From 1faeef7924c535e9003b617b723b85567a821f5c Mon Sep 17 00:00:00 2001
From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Sun, 14 Aug 2022 12:28:37 -0400
Subject: (compiled-function-p): New function (bug#56648)

* lisp/subr.el (compiled-function-p): New function.

* test/lisp/international/ucs-normalize-tests.el (ucs-normalize-part1):
* lisp/gnus/gnus.el (gnus):
* lisp/mh-e/mh-e.el (mh-version):
* lisp/emacs-lisp/macroexp.el (emacs-startup-hook):
* lisp/emacs-lisp/cl-macs.el (compiled-function):
* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition)
(byte-compile, display-call-tree):
* lisp/emacs-lisp/byte-opt.el (<toplevel-end>):
* lisp/emacs-lisp/advice.el (ad-compiled-p):
* lisp/cedet/semantic/bovine.el (semantic-bovinate-stream):
* lisp/loadup.el (macroexpand-all):
* admin/unidata/unidata-gen.el (unidata--ensure-compiled): Use it.

* lisp/emacs-lisp/pcase.el (pcase-mutually-exclusive-predicates):
Add entries for it.
(pcase--split-pred): Use it.

* lisp/help-fns.el (help-fns-function-description-header): Use `functionp`.
(help-fns--var-safe-local): Use `compiled-function-p`.
---
 lisp/emacs-lisp/advice.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'lisp/emacs-lisp/advice.el')

diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 391743d7156..d383650f4e5 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -1054,9 +1054,9 @@
 ;;   (print "Let's clean up now!"))
 ;; foo
 ;;
-;; Now `foo's advice is byte-compiled:
+;; Now `foo's advice is compiled:
 ;;
-;; (byte-code-function-p 'ad-Advice-foo)
+;; (compiled-function-p 'ad-Advice-foo)
 ;; t
 ;;
 ;; (foo 3)
@@ -1298,7 +1298,7 @@
 ;; constructed during preactivation was used, even though we did not specify
 ;; the `compile' flag:
 ;;
-;; (byte-code-function-p 'ad-Advice-fum)
+;; (compiled-function-p 'ad-Advice-fum)
 ;; t
 ;;
 ;; (fum 2)
@@ -1329,7 +1329,7 @@
 ;;
 ;; A new uncompiled advised definition got constructed:
 ;;
-;; (byte-code-function-p 'ad-Advice-fum)
+;; (compiled-function-p 'ad-Advice-fum)
 ;; nil
 ;;
 ;; (fum 2)
@@ -2116,9 +2116,9 @@ the cache-id will clear the cache."
 
 (defsubst ad-compiled-p (definition)
   "Return non-nil if DEFINITION is a compiled byte-code object."
-  (or (byte-code-function-p definition)
-       (and (macrop definition)
-            (byte-code-function-p (ad-lambdafy definition)))))
+  (or (compiled-function-p definition)
+      (and (macrop definition)
+           (compiled-function-p (ad-lambdafy definition)))))
 
 (defsubst ad-compiled-code (compiled-definition)
   "Return the byte-code object of a COMPILED-DEFINITION."
-- 
cgit v1.2.3