Mercurial > emacs
comparison src/eval.c @ 83648:65663fcd2caa
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 824-838)
- Update from CVS
- Merge from emacs--rel--22
- Remove lisp/erc/erc-nicklist.el
- Update some .arch-inventory files
- Fix void function definition error in cus-edit.el
- Restore lisp/emacs-lisp/cl-loaddefs.el
* emacs--rel--22 (patch 70-83)
- Update from CVS
- Remove lisp/erc/erc-nicklist.el
- Update some .arch-inventory files
- Indicate that emacs--devo--0--patch-834 does not need to be applied
- Merge from gnus--rel--5.10
- Restore lisp/emacs-lisp/cl-loaddefs.el
* gnus--rel--5.10 (patch 239-241)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-28
| author | Miles Bader <miles@gnu.org> |
|---|---|
| date | Tue, 31 Jul 2007 05:50:45 +0000 |
| parents | fd5b4a865d1d b98604865ea0 |
| children | 5b644ae74c91 |
comparison
equal
deleted
inserted
replaced
| 83647:3468e549a55b | 83648:65663fcd2caa |
|---|---|
| 4 | 4 |
| 5 This file is part of GNU Emacs. | 5 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, |
| 13 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 2048 (function, for_call_interactively) | 2048 (function, for_call_interactively) |
| 2049 Lisp_Object function, for_call_interactively; | 2049 Lisp_Object function, for_call_interactively; |
| 2050 { | 2050 { |
| 2051 register Lisp_Object fun; | 2051 register Lisp_Object fun; |
| 2052 register Lisp_Object funcar; | 2052 register Lisp_Object funcar; |
| 2053 Lisp_Object if_prop = Qnil; | |
| 2053 | 2054 |
| 2054 fun = function; | 2055 fun = function; |
| 2055 | 2056 |
| 2056 fun = indirect_function (fun); | 2057 fun = indirect_function (fun); /* Check cycles. */ |
| 2057 if (EQ (fun, Qunbound)) | 2058 if (NILP (fun) || EQ (fun, Qunbound)) |
| 2058 return Qnil; | 2059 return Qnil; |
| 2060 | |
| 2061 /* Check an `interactive-form' property if present, analogous to the | |
| 2062 function-documentation property. */ | |
| 2063 fun = function; | |
| 2064 while (SYMBOLP (fun)) | |
| 2065 { | |
| 2066 Lisp_Object tmp = Fget (fun, intern ("interactive-form")); | |
| 2067 if (!NILP (tmp)) | |
| 2068 if_prop = Qt; | |
| 2069 fun = Fsymbol_function (fun); | |
| 2070 } | |
| 2059 | 2071 |
| 2060 /* Emacs primitives are interactive if their DEFUN specifies an | 2072 /* Emacs primitives are interactive if their DEFUN specifies an |
| 2061 interactive spec. */ | 2073 interactive spec. */ |
| 2062 if (SUBRP (fun)) | 2074 if (SUBRP (fun)) |
| 2063 { | 2075 return XSUBR (fun)->prompt ? Qt : if_prop; |
| 2064 if (XSUBR (fun)->prompt) | |
| 2065 return Qt; | |
| 2066 else | |
| 2067 return Qnil; | |
| 2068 } | |
| 2069 | 2076 |
| 2070 /* Bytecode objects are interactive if they are long enough to | 2077 /* Bytecode objects are interactive if they are long enough to |
| 2071 have an element whose index is COMPILED_INTERACTIVE, which is | 2078 have an element whose index is COMPILED_INTERACTIVE, which is |
| 2072 where the interactive spec is stored. */ | 2079 where the interactive spec is stored. */ |
| 2073 else if (COMPILEDP (fun)) | 2080 else if (COMPILEDP (fun)) |
| 2074 return ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE | 2081 return ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE |
| 2075 ? Qt : Qnil); | 2082 ? Qt : if_prop); |
| 2076 | 2083 |
| 2077 /* Strings and vectors are keyboard macros. */ | 2084 /* Strings and vectors are keyboard macros. */ |
| 2078 if (NILP (for_call_interactively) && (STRINGP (fun) || VECTORP (fun))) | 2085 if (STRINGP (fun) || VECTORP (fun)) |
| 2079 return Qt; | 2086 return NILP (for_call_interactively) ? Qt : Qnil; |
| 2080 | 2087 |
| 2081 /* Lists may represent commands. */ | 2088 /* Lists may represent commands. */ |
| 2082 if (!CONSP (fun)) | 2089 if (!CONSP (fun)) |
| 2083 return Qnil; | 2090 return Qnil; |
| 2084 funcar = XCAR (fun); | 2091 funcar = XCAR (fun); |
| 2085 if (EQ (funcar, Qlambda)) | 2092 if (EQ (funcar, Qlambda)) |
| 2086 return Fassq (Qinteractive, Fcdr (XCDR (fun))); | 2093 return !NILP (Fassq (Qinteractive, Fcdr (XCDR (fun)))) ? Qt : if_prop; |
| 2087 if (EQ (funcar, Qautoload)) | 2094 if (EQ (funcar, Qautoload)) |
| 2088 return Fcar (Fcdr (Fcdr (XCDR (fun)))); | 2095 return !NILP (Fcar (Fcdr (Fcdr (XCDR (fun))))) ? Qt : if_prop; |
| 2089 else | 2096 else |
| 2090 return Qnil; | 2097 return Qnil; |
| 2091 } | 2098 } |
| 2092 | 2099 |
| 2093 /* ARGSUSED */ | 2100 /* ARGSUSED */ |
