From 89835619ddf133f28a7c015db964f491c5eab610 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 25 Jul 2007 06:24:58 +0000 Subject: [PATCH] (Finteractive_form): Use a `interactive-form' property if present, analogous to the function-documentation property. --- etc/NEWS | 4 ++++ src/ChangeLog | 5 +++++ src/data.c | 10 ++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 898425997d1..da71e302ba5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -204,6 +204,10 @@ remote connection has been established already. ** 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 --git a/src/ChangeLog b/src/ChangeLog index ac6b24aaffa..bfdf9abb5d2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 --git a/src/data.c b/src/data.c index 0b3be2fc694..f705aa559e8 100644 --- a/src/data.c +++ b/src/data.c @@ -751,8 +751,14 @@ Value, if non-nil, is a list \(interactive SPEC). */) 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)); -- 2.39.2