diff options
author | Miles Bader <miles@gnu.org> | 2007-07-27 10:52:18 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-07-27 10:52:18 +0000 |
commit | e468b87f91f26e66a8cde087c1a9c89c67b96d12 (patch) | |
tree | 7cf1ded30152bb0ddd4bbff544693a05b3b62911 /src/eval.c | |
parent | b692c96bfa9b8bedd6e093a6c571624442db2e2a (diff) | |
parent | 05bfa8f34f3eedec3ad2fdb45971476a8c8f49b1 (diff) | |
download | emacs-e468b87f91f26e66a8cde087c1a9c89c67b96d12.tar.gz |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 824-831)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 70-74)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-238
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/eval.c b/src/eval.c index 7d7e73484f7..78316eb1a3c 100644 --- a/src/eval.c +++ b/src/eval.c @@ -6,7 +6,7 @@ This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, @@ -2040,42 +2040,49 @@ then strings and vectors are not accepted. */) { register Lisp_Object fun; register Lisp_Object funcar; + Lisp_Object if_prop = Qnil; fun = function; - fun = indirect_function (fun); - if (EQ (fun, Qunbound)) + fun = indirect_function (fun); /* Check cycles. */ + if (NILP (fun) || EQ (fun, Qunbound)) return Qnil; + /* Check an `interactive-form' property if present, analogous to the + function-documentation property. */ + fun = function; + while (SYMBOLP (fun)) + { + Lisp_Object tmp = Fget (fun, intern ("interactive-form")); + if (!NILP (tmp)) + if_prop = Qt; + fun = Fsymbol_function (fun); + } + /* Emacs primitives are interactive if their DEFUN specifies an interactive spec. */ if (SUBRP (fun)) - { - if (XSUBR (fun)->prompt) - return Qt; - else - return Qnil; - } + return XSUBR (fun)->prompt ? Qt : if_prop; /* Bytecode objects are interactive if they are long enough to have an element whose index is COMPILED_INTERACTIVE, which is where the interactive spec is stored. */ else if (COMPILEDP (fun)) return ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE - ? Qt : Qnil); + ? Qt : if_prop); /* Strings and vectors are keyboard macros. */ - if (NILP (for_call_interactively) && (STRINGP (fun) || VECTORP (fun))) - return Qt; + if (STRINGP (fun) || VECTORP (fun)) + return NILP (for_call_interactively) ? Qt : Qnil; /* Lists may represent commands. */ if (!CONSP (fun)) return Qnil; funcar = XCAR (fun); if (EQ (funcar, Qlambda)) - return Fassq (Qinteractive, Fcdr (XCDR (fun))); + return !NILP (Fassq (Qinteractive, Fcdr (XCDR (fun)))) ? Qt : if_prop; if (EQ (funcar, Qautoload)) - return Fcar (Fcdr (Fcdr (XCDR (fun)))); + return !NILP (Fcar (Fcdr (Fcdr (XCDR (fun))))) ? Qt : if_prop; else return Qnil; } |