changeset 55230:c41874c7d876

(Fsubr_name): New fun. (syms_of_data): Defsubr it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 29 Apr 2004 18:21:48 +0000
parents cf075c4ac9e5
children 7fc34677dcb8
files src/ChangeLog src/data.c
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Apr 29 15:34:58 2004 +0000
+++ b/src/ChangeLog	Thu Apr 29 18:21:48 2004 +0000
@@ -1,3 +1,8 @@
+2004-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* data.c (Fsubr_name): New fun.
+	(syms_of_data): Defsubr it.
+
 2004-04-29  Kim F. Storm  <storm@cua.dk>
 
 	* xdisp.c (null_glyph_slice): New var.
--- a/src/data.c	Thu Apr 29 15:34:58 2004 +0000
+++ b/src/data.c	Thu Apr 29 18:21:48 2004 +0000
@@ -761,6 +761,19 @@
     return Fcons (make_number (minargs), make_number (maxargs));
 }
 
+DEFUN ("subr-name", Fsubr_name, Ssubr_name, 1, 1, 0,
+       doc: /* Return name of subroutine SUBR.
+SUBR must be a built-in function.  */)
+     (subr)
+     Lisp_Object subr;
+{
+  const char *name;
+  if (!SUBRP (subr))
+    wrong_type_argument (Qsubrp, subr);
+  name = XSUBR (subr)->symbol_name;
+  return make_string (name, strlen (name));
+}
+
 DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0,
        doc: /* Return the interactive form of CMD or nil if none.
 CMD must be a command.  Value, if non-nil, is a list
@@ -3319,6 +3332,7 @@
   defsubr (&Slognot);
   defsubr (&Sbyteorder);
   defsubr (&Ssubr_arity);
+  defsubr (&Ssubr_name);
 
   XSYMBOL (Qwholenump)->function = XSYMBOL (Qnatnump)->function;