changeset 44941:857c2abe3324

(Fcommandp): New arg for_call_interactively.
author Richard M. Stallman <rms@gnu.org>
date Sun, 28 Apr 2002 22:06:38 +0000
parents 2686a6ef3d19
children 972dc81abf82
files src/eval.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c	Sun Apr 28 22:06:17 2002 +0000
+++ b/src/eval.c	Sun Apr 28 22:06:38 2002 +0000
@@ -1761,7 +1761,7 @@
   abort ();
 }
 
-DEFUN ("commandp", Fcommandp, Scommandp, 1, 1, 0,
+DEFUN ("commandp", Fcommandp, Scommandp, 1, 2, 0,
        doc: /* Non-nil if FUNCTION makes provisions for interactive calling.
 This means it contains a description for how to read arguments to give it.
 The value is nil for an invalid function or a symbol with no function
@@ -1772,9 +1772,12 @@
 to `interactive', autoload definitions made by `autoload' with non-nil
 fourth argument, and some of the built-in functions of Lisp.
 
-Also, a symbol satisfies `commandp' if its function definition does so.  */)
-     (function)
-     Lisp_Object function;
+Also, a symbol satisfies `commandp' if its function definition does so.
+
+If the optional argument FOR-CALL-INTERACTIVELY is non-nil,
+then strins and vectors are not accepted.  */)
+     (function, for_call_interactively)
+     Lisp_Object function, for_call_interactively;
 {
   register Lisp_Object fun;
   register Lisp_Object funcar;
@@ -1803,7 +1806,7 @@
 	    ? Qt : Qnil);
 
   /* Strings and vectors are keyboard macros.  */
-  if (STRINGP (fun) || VECTORP (fun))
+  if (NILP (for_call_interactively) && (STRINGP (fun) || VECTORP (fun)))
     return Qt;
 
   /* Lists may represent commands.  */