commit: Provide #'special-form-p, for the use of advice.el, perhaps other files.

Aidan Kehoe aidan-guest at alioth.debian.org
Tue Dec 18 15:51:28 EST 2007


changeset:   4334:cdc2f70d43199e6f413f22bfb4484c18c8ef25f1
tag:         tip
user:        Aidan Kehoe <kehoea at parhasard.net>
date:        Tue Dec 18 21:47:27 2007 +0100
files:       src/ChangeLog src/symbols.c
description:
Provide #'special-form-p, for the use of advice.el, perhaps other files.

2007-12-18  Aidan Kehoe  <kehoea at parhasard.net>

	* symbols.c (Fspecial_form_p): New.
	For the use of advice.el, and perhaps other files; is SUBR a
	special form?


diff -r 4ba890988caa681f3dfc4cf8fbe23b25df9ec8dc -r cdc2f70d43199e6f413f22bfb4484c18c8ef25f1 src/ChangeLog
--- a/src/ChangeLog	Tue Dec 18 21:28:12 2007 +0100
+++ b/src/ChangeLog	Tue Dec 18 21:47:27 2007 +0100
@@ -1,3 +1,9 @@ 2007-12-17  Aidan Kehoe  <kehoea at parhasa
+2007-12-18  Aidan Kehoe  <kehoea at parhasard.net>
+
+	* symbols.c (Fspecial_form_p): New.
+	For the use of advice.el, and perhaps other files; is SUBR a
+	special form?
+
 2007-12-17  Aidan Kehoe  <kehoea at parhasard.net>
 
 	* doprnt.c (emacs_doprnt_1):
diff -r 4ba890988caa681f3dfc4cf8fbe23b25df9ec8dc -r cdc2f70d43199e6f413f22bfb4484c18c8ef25f1 src/symbols.c
--- a/src/symbols.c	Tue Dec 18 21:28:12 2007 +0100
+++ b/src/symbols.c	Tue Dec 18 21:47:27 2007 +0100
@@ -730,6 +730,17 @@ SUBR must be a built-in function.
 
   name = XSUBR (subr)->name;
   return make_string ((const Ibyte *)name, strlen (name));
+}
+
+DEFUN ("special-form-p", Fspecial_form_p, 1, 1, 0, /*
+Return whether SUBR is a special form.  SUBR must be built-in.
+*/
+       (subr))
+{
+  subr = indirect_function (subr, 1);
+  CHECK_SUBR (subr);
+
+  return XSUBR (subr)->max_args == UNEVALLED ? Qt : Qnil;
 }
 
 DEFUN ("setplist", Fsetplist, 2, 2, 0, /*
@@ -3719,6 +3730,7 @@ syms_of_symbols (void)
   DEFSUBR (Fdefine_function);
   Ffset (intern ("defalias"), intern ("define-function"));
   DEFSUBR (Fsubr_name);
+  DEFSUBR (Fspecial_form_p);
   DEFSUBR (Fsetplist);
   DEFSUBR (Fsymbol_value_in_buffer);
   DEFSUBR (Fsymbol_value_in_console);





More information about the XEmacs-Patches mailing list