branch: externals/compat
commit 80dbd9bc5efee05a479663f8cfd0cc9e0a30dac5
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    compat-28: Mark subr-native-elisp-p as obsolete
    
    The function has been renamed to native-comp-function-p in Emacs 30.
---
 NEWS.org        | 4 ++++
 compat-28.el    | 5 +++--
 compat-tests.el | 8 +++++---
 compat.texi     | 7 -------
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index c466a003a7..43796ad29c 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -2,6 +2,10 @@
 #+link:    compat-gh   https://github.com/emacs-compat/compat/issues/
 #+options: toc:nil num:nil author:nil
 
+* Development
+
+- compat-28: Mark =subr-native-elisp-p= as obsolete (renamed in Emacs 30).
+
 * Release of "Compat" Version 29.1.4.5
 
 - Minor optimization of ~plist-get~ and ~plist-put~.
diff --git a/compat-28.el b/compat-28.el
index b5730b11f4..12e7b480f8 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -396,7 +396,8 @@ not a list, return a one-element list containing OBJECT."
 
 ;;;; Defined in data.c
 
-(compat-defalias subr-native-elisp-p ignore) ;; 
<compat-tests:subr-native-elisp-p>
+;; Renamed in Emacs 30 to `native-comp-function-p'.
+(compat-defalias subr-native-elisp-p ignore :obsolete t) ;; 
<compat-tests:obsolete-subr-native-elisp-p>
 
 ;;;; Defined in subr-x.el
 
@@ -835,7 +836,7 @@ function will never return nil."
 ;;;; Defined in button.el
 
 ;; Obsolete Alias since 29
-(compat-defalias button-buttonize buttonize :obsolete t) ;; 
<compat-tests:button-buttonize>
+(compat-defalias button-buttonize buttonize :obsolete t) ;; 
<compat-tests:obsolete-button-buttonize>
 
 ;;;; Defined in wid-edit.el
 
diff --git a/compat-tests.el b/compat-tests.el
index fe1c723052..4354bd02e1 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -216,7 +216,7 @@
     (should-equal 'h (get-text-property 0 'help-echo b))
     (should-equal 'h (get-text-property 5 'help-echo b))))
 
-(ert-deftest compat-button-buttonize ()
+(ert-deftest compat-obsolete-button-buttonize ()
   (let ((b (with-no-warnings (button-buttonize "button" 'c 'd))))
     (should-equal b "button")
     (should-equal 'c (get-text-property 0 'action b))
@@ -1300,8 +1300,10 @@
 (ert-deftest compat-native-comp-available-p ()
   (should (memq (native-comp-available-p) '(nil t))))
 
-(ert-deftest compat-subr-native-elisp-p ()
-  (should-not (subr-native-elisp-p (symbol-function 'identity))))
+(ert-deftest compat-obsolete-subr-native-elisp-p ()
+  (with-no-warnings
+    (compat-tests--if (< emacs-major-version 30)
+        (should-not (subr-native-elisp-p (symbol-function 'identity))))))
 
 (ert-deftest compat-subr-primitive-p ()
   (should (subr-primitive-p (symbol-function 'identity)))       ;function from 
fns.c
diff --git a/compat.texi b/compat.texi
index f49ecb02d0..468e652440 100644
--- a/compat.texi
+++ b/compat.texi
@@ -2152,13 +2152,6 @@ native compilation is not available, this function 
behaves identically
 to @code{subrp}.
 @end defun
 
-@c based on lisp/subr.el
-@defun subr-native-elisp-p object
-Return @code{t} if @var{object} if the object is native compiled lisp.
-If native compilation is not available, this function always returns
-@code{nil}.
-@end defun
-
 @c copied from lispref/compile.texi
 @defun native-comp-available-p
 This function returns non-@code{nil} if the running Emacs process has

Reply via email to