# HG changeset patch # User Stefan Monnier # Date 1185344698 0 # Node ID fac8f54212138f98381809a2406b85dbee3c6261 # Parent 5b55db78e6d891ca7c5a135f6a81339b5f6128d8 (Finteractive_form): Use a `interactive-form' property if present, analogous to the function-documentation property. diff -r 5b55db78e6d8 -r fac8f5421213 etc/NEWS --- a/etc/NEWS Wed Jul 25 04:32:23 2007 +0000 +++ b/etc/NEWS Wed Jul 25 06:24:58 2007 +0000 @@ -204,6 +204,10 @@ ** The two new functions `looking-at-p' and `string-match-p' can do the same matching as `looking-at' and `string-match' without changing the match data. + +** The interactive-form of a function can be added post-facto via the +`interactive-form' symbol property. Mostly useful to add complex interactive +forms to subroutines. * New Packages for Lisp Programming in Emacs 23.1 diff -r 5b55db78e6d8 -r fac8f5421213 src/ChangeLog --- a/src/ChangeLog Wed Jul 25 04:32:23 2007 +0000 +++ b/src/ChangeLog Wed Jul 25 06:24:58 2007 +0000 @@ -1,3 +1,8 @@ +2007-07-25 Stefan Monnier + + * data.c (Finteractive_form): Use a `interactive-form' property if + present, analogous to the function-documentation property. + 2007-07-22 Nick Roberts * xdisp.c (decode_mode_spec): Add case 'R' for to test for diff -r 5b55db78e6d8 -r fac8f5421213 src/data.c --- a/src/data.c Wed Jul 25 04:32:23 2007 +0000 +++ b/src/data.c Wed Jul 25 06:24:58 2007 +0000 @@ -751,8 +751,14 @@ Lisp_Object cmd; { Lisp_Object fun = indirect_function (cmd); - - if (SUBRP (fun)) + Lisp_Object tmp; + + if (SYMBOLP (cmd) + /* Use an `interactive-form' property if present, analogous to the + function-documentation property. */ + && (tmp = Fget (cmd, intern ("interactive-form")), !NILP (tmp))) + return tmp; + else if (SUBRP (fun)) { if (XSUBR (fun)->prompt) return list2 (Qinteractive, build_string (XSUBR (fun)->prompt));