Mercurial > emacs
comparison src/data.c @ 82112:dd8905ab6eaa
(Finteractive_form): Check for the presence of an
`interactive-form' symbol property more thoroughly.
| author | Stefan Monnier <monnier@iro.umontreal.ca> |
|---|---|
| date | Wed, 25 Jul 2007 21:03:24 +0000 |
| parents | fac8f5421213 |
| children | b98604865ea0 |
comparison
equal
deleted
inserted
replaced
| 82111:63aefab8fbc3 | 82112:dd8905ab6eaa |
|---|---|
| 748 If CMD is not a command, the return value is nil. | 748 If CMD is not a command, the return value is nil. |
| 749 Value, if non-nil, is a list \(interactive SPEC). */) | 749 Value, if non-nil, is a list \(interactive SPEC). */) |
| 750 (cmd) | 750 (cmd) |
| 751 Lisp_Object cmd; | 751 Lisp_Object cmd; |
| 752 { | 752 { |
| 753 Lisp_Object fun = indirect_function (cmd); | 753 Lisp_Object fun = indirect_function (cmd); /* Check cycles. */ |
| 754 Lisp_Object tmp; | 754 |
| 755 | 755 if (NILP (fun) || EQ (fun, Qunbound)) |
| 756 if (SYMBOLP (cmd) | 756 return Qnil; |
| 757 /* Use an `interactive-form' property if present, analogous to the | 757 |
| 758 function-documentation property. */ | 758 /* Use an `interactive-form' property if present, analogous to the |
| 759 && (tmp = Fget (cmd, intern ("interactive-form")), !NILP (tmp))) | 759 function-documentation property. */ |
| 760 return tmp; | 760 fun = cmd; |
| 761 else if (SUBRP (fun)) | 761 while (SYMBOLP (fun)) |
| 762 { | |
| 763 Lisp_Object tmp = Fget (fun, intern ("interactive-form")); | |
| 764 if (!NILP (tmp)) | |
| 765 return tmp; | |
| 766 else | |
| 767 fun = Fsymbol_function (fun); | |
| 768 } | |
| 769 | |
| 770 if (SUBRP (fun)) | |
| 762 { | 771 { |
| 763 if (XSUBR (fun)->prompt) | 772 if (XSUBR (fun)->prompt) |
| 764 return list2 (Qinteractive, build_string (XSUBR (fun)->prompt)); | 773 return list2 (Qinteractive, build_string (XSUBR (fun)->prompt)); |
| 765 } | 774 } |
| 766 else if (COMPILEDP (fun)) | 775 else if (COMPILEDP (fun)) |
