]> git.eshelyaron.com Git - emacs.git/commitdiff
Rename `subr-native-elisp` to `native-comp-function` (bug#71123)
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 22 May 2024 17:45:39 +0000 (13:45 -0400)
committerEshel Yaron <me@eshelyaron.com>
Wed, 29 May 2024 10:12:39 +0000 (12:12 +0200)
Now that this type name is displayed in *Help*, it is more
important to use a name that is less weird for the unsuspecting user.

* lisp/emacs-lisp/cl-preloaded.el (cl-functionp): Adjust to new name of
native function's type.
(subr-native-elisp-p): Redefine as an obsolete alias.
(native-comp-function): Rename from `subr-native-elisp`

* src/data.c (Fcl_type_of): Return `Qnative_comp_function` i.s.o
`Qsubr_native_elisp`.
(Fnative_comp_function_p): Rename from `Fsubr_native_elisp_p`.
(syms_of_data): Adjust accordingly.

* src/doc.c (Fsubr_documentation): Use new `Fnative_comp_function_p` name.

(cherry picked from commit 1a1170cde7e847f4eb4d736a400f7325f2265a1c)

etc/NEWS
lisp/emacs-lisp/cl-preloaded.el
src/data.c
src/doc.c

index c3ba376d822fd43e40de80897afc5ef0293b1c38..3efd5612f07d9f49d135728ac8c501f48ba380cd 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1993,6 +1993,10 @@ documentation and examples.
 \f
 * Incompatible Lisp Changes in Emacs 30.1
 
+---
+** 'subr-native-elisp-p' is renamed to 'native-comp-function-p'.
+The previous name still exists but is marked as obsolete.
+
 +++
 ** Evaluating a 'lambda' returns an object of type 'interpreted-function'.
 Instead of representing interpreted functions as lists that start with
index fa745396b02758634540b5abd22aab5777056456..4b1bd2a9aff8540549eb2d8514ecc6c3f985bd6c 100644 (file)
@@ -355,7 +355,7 @@ The `slots' (and hence `index-table') are currently unused."
 This is like `functionp' except that it returns nil for all lists and symbols,
 regardless if `funcall' would accept to call them."
   (memq (cl-type-of object)
-        '(primitive-function subr-native-elisp module-function
+        '(primitive-function native-comp-function module-function
           interpreted-function byte-code-function)))
 
 (cl--define-built-in-type t nil "Abstract supertype of everything.")
@@ -465,7 +465,8 @@ The fields are used as follows:
   "Type of functions that have not been compiled.")
 (cl--define-built-in-type special-form (subr)
   "Type of the core syntactic elements of the Emacs Lisp language.")
-(cl--define-built-in-type subr-native-elisp (subr compiled-function)
+(define-obsolete-function-alias 'subr-native-elisp-p #'native-comp-function-p "30.1")
+(cl--define-built-in-type native-comp-function (subr compiled-function)
   "Type of functions that have been compiled by the native compiler.")
 (cl--define-built-in-type primitive-function (subr compiled-function)
   "Type of functions hand written in C.")
index be7ae023d8d2c4af26dc8217501e17cf6fcef390..e6106a1dbdfde79c1e74595a96372bf8ce6a461b 100644 (file)
@@ -239,7 +239,7 @@ a fixed set of types.  */)
         case PVEC_WINDOW: return Qwindow;
         case PVEC_SUBR:
           return XSUBR (object)->max_args == UNEVALLED ? Qspecial_form
-                 : SUBR_NATIVE_COMPILEDP (object) ? Qsubr_native_elisp
+                 : SUBR_NATIVE_COMPILEDP (object) ? Qnative_comp_function
                  : Qprimitive_function;
         case PVEC_CLOSURE:
           return CONSP (AREF (object, CLOSURE_CODE))
@@ -1055,9 +1055,8 @@ SUBR must be a built-in function.  */)
   return build_string (name);
 }
 
-DEFUN ("subr-native-elisp-p", Fsubr_native_elisp_p, Ssubr_native_elisp_p, 1, 1,
-       0, doc: /* Return t if the object is native compiled lisp
-function, nil otherwise.  */)
+DEFUN ("native-comp-function-p", Fnative_comp_function_p, Snative_comp_function_p, 1, 1,
+       0, doc: /* Return t if the object is native compiled Lisp function, nil otherwise.  */)
   (Lisp_Object object)
 {
   return SUBR_NATIVE_COMPILEDP (object) ? Qt : Qnil;
@@ -4163,7 +4162,8 @@ syms_of_data (void)
   DEFSYM (Qsubr, "subr");
   DEFSYM (Qspecial_form, "special-form");
   DEFSYM (Qprimitive_function, "primitive-function");
-  DEFSYM (Qsubr_native_elisp, "subr-native-elisp");
+  DEFSYM (Qsubr_native_elisp, "subr-native-elisp"); /* Deprecated name.  */
+  DEFSYM (Qnative_comp_function, "native-comp-function");
   DEFSYM (Qbyte_code_function, "byte-code-function");
   DEFSYM (Qinterpreted_function, "interpreted-function");
   DEFSYM (Qbuffer, "buffer");
@@ -4298,7 +4298,7 @@ syms_of_data (void)
   defsubr (&Sbyteorder);
   defsubr (&Ssubr_arity);
   defsubr (&Ssubr_name);
-  defsubr (&Ssubr_native_elisp_p);
+  defsubr (&Snative_comp_function_p);
   defsubr (&Ssubr_native_lambda_list);
   defsubr (&Ssubr_type);
 #ifdef HAVE_NATIVE_COMP
index f516db3bbccebf48c896078097f5b2645a51d783..7bff8bd8edb0a15599ac06954a0aed32feb752b5 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -392,7 +392,7 @@ DEFUN ("internal-subr-documentation", Fsubr_documentation, Ssubr_documentation,
   (Lisp_Object function)
 {
 #ifdef HAVE_NATIVE_COMP
-  if (!NILP (Fsubr_native_elisp_p (function)))
+  if (!NILP (Fnative_comp_function_p (function)))
     return native_function_doc (function);
   else
 #endif