diff options
| author | Miles Bader | 2007-07-27 10:52:18 +0000 |
|---|---|---|
| committer | Miles Bader | 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 emacs-e468b87f91f26e66a8cde087c1a9c89c67b96d12.zip | |
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. | |||
| 6 | 6 | ||
| 7 | GNU Emacs is free software; you can redistribute it and/or modify | 7 | GNU Emacs is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation; either version 2, or (at your option) | 9 | the Free Software Foundation; either version 3, or (at your option) |
| 10 | any later version. | 10 | any later version. |
| 11 | 11 | ||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | 12 | GNU Emacs is distributed in the hope that it will be useful, |
| @@ -2040,42 +2040,49 @@ then strings and vectors are not accepted. */) | |||
| 2040 | { | 2040 | { |
| 2041 | register Lisp_Object fun; | 2041 | register Lisp_Object fun; |
| 2042 | register Lisp_Object funcar; | 2042 | register Lisp_Object funcar; |
| 2043 | Lisp_Object if_prop = Qnil; | ||
| 2043 | 2044 | ||
| 2044 | fun = function; | 2045 | fun = function; |
| 2045 | 2046 | ||
| 2046 | fun = indirect_function (fun); | 2047 | fun = indirect_function (fun); /* Check cycles. */ |
| 2047 | if (EQ (fun, Qunbound)) | 2048 | if (NILP (fun) || EQ (fun, Qunbound)) |
| 2048 | return Qnil; | 2049 | return Qnil; |
| 2049 | 2050 | ||
| 2051 | /* Check an `interactive-form' property if present, analogous to the | ||
| 2052 | function-documentation property. */ | ||
| 2053 | fun = function; | ||
| 2054 | while (SYMBOLP (fun)) | ||
| 2055 | { | ||
| 2056 | Lisp_Object tmp = Fget (fun, intern ("interactive-form")); | ||
| 2057 | if (!NILP (tmp)) | ||
| 2058 | if_prop = Qt; | ||
| 2059 | fun = Fsymbol_function (fun); | ||
| 2060 | } | ||
| 2061 | |||
| 2050 | /* Emacs primitives are interactive if their DEFUN specifies an | 2062 | /* Emacs primitives are interactive if their DEFUN specifies an |
| 2051 | interactive spec. */ | 2063 | interactive spec. */ |
| 2052 | if (SUBRP (fun)) | 2064 | if (SUBRP (fun)) |
| 2053 | { | 2065 | return XSUBR (fun)->prompt ? Qt : if_prop; |
| 2054 | if (XSUBR (fun)->prompt) | ||
| 2055 | return Qt; | ||
| 2056 | else | ||
| 2057 | return Qnil; | ||
| 2058 | } | ||
| 2059 | 2066 | ||
| 2060 | /* Bytecode objects are interactive if they are long enough to | 2067 | /* Bytecode objects are interactive if they are long enough to |
| 2061 | have an element whose index is COMPILED_INTERACTIVE, which is | 2068 | have an element whose index is COMPILED_INTERACTIVE, which is |
| 2062 | where the interactive spec is stored. */ | 2069 | where the interactive spec is stored. */ |
| 2063 | else if (COMPILEDP (fun)) | 2070 | else if (COMPILEDP (fun)) |
| 2064 | return ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE | 2071 | return ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE |
| 2065 | ? Qt : Qnil); | 2072 | ? Qt : if_prop); |
| 2066 | 2073 | ||
| 2067 | /* Strings and vectors are keyboard macros. */ | 2074 | /* Strings and vectors are keyboard macros. */ |
| 2068 | if (NILP (for_call_interactively) && (STRINGP (fun) || VECTORP (fun))) | 2075 | if (STRINGP (fun) || VECTORP (fun)) |
| 2069 | return Qt; | 2076 | return NILP (for_call_interactively) ? Qt : Qnil; |
| 2070 | 2077 | ||
| 2071 | /* Lists may represent commands. */ | 2078 | /* Lists may represent commands. */ |
| 2072 | if (!CONSP (fun)) | 2079 | if (!CONSP (fun)) |
| 2073 | return Qnil; | 2080 | return Qnil; |
| 2074 | funcar = XCAR (fun); | 2081 | funcar = XCAR (fun); |
| 2075 | if (EQ (funcar, Qlambda)) | 2082 | if (EQ (funcar, Qlambda)) |
| 2076 | return Fassq (Qinteractive, Fcdr (XCDR (fun))); | 2083 | return !NILP (Fassq (Qinteractive, Fcdr (XCDR (fun)))) ? Qt : if_prop; |
| 2077 | if (EQ (funcar, Qautoload)) | 2084 | if (EQ (funcar, Qautoload)) |
| 2078 | return Fcar (Fcdr (Fcdr (XCDR (fun)))); | 2085 | return !NILP (Fcar (Fcdr (Fcdr (XCDR (fun))))) ? Qt : if_prop; |
| 2079 | else | 2086 | else |
| 2080 | return Qnil; | 2087 | return Qnil; |
| 2081 | } | 2088 | } |