From: Stefan Monnier Date: Thu, 29 Apr 2004 18:21:48 +0000 (+0000) Subject: (Fsubr_name): New fun. X-Git-Tag: ttn-vms-21-2-B4~6524 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0fddae66f4ac29a98fd7073ba4a1fdfc5139fa17;p=emacs.git (Fsubr_name): New fun. (syms_of_data): Defsubr it. --- diff --git a/src/ChangeLog b/src/ChangeLog index 386c3d99a47..9be37a38531 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-04-29 Stefan Monnier + + * data.c (Fsubr_name): New fun. + (syms_of_data): Defsubr it. + 2004-04-29 Kim F. Storm * xdisp.c (null_glyph_slice): New var. diff --git a/src/data.c b/src/data.c index a5f28375635..c94723d09d0 100644 --- a/src/data.c +++ b/src/data.c @@ -761,6 +761,19 @@ function with `&rest' args, or `unevalled' for a special form. */) 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 @@ syms_of_data () defsubr (&Slognot); defsubr (&Sbyteorder); defsubr (&Ssubr_arity); + defsubr (&Ssubr_name); XSYMBOL (Qwholenump)->function = XSYMBOL (Qnatnump)->function;