From: Eli Zaretskii Date: Wed, 15 Oct 2008 20:22:21 +0000 (+0000) Subject: (Defining Commands, Using Interactive): The interactive-form of a function X-Git-Tag: emacs-pretest-23.0.90~2451 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c3aaf1d70f7d4baafb8c4f6d67d1de3283625c9a;p=emacs.git (Defining Commands, Using Interactive): The interactive-form of a function can be added via its symbol's property. --- diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 67168f6a1eb..e8139afdb2a 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,11 +1,16 @@ 2008-10-15 Eli Zaretskii + * internals.texi (Writing Emacs Primitives): The interactive spec + of a primitive can be a Lisp form. + * markers.texi (The Mark): Document the `lambda' and `(only . OLD)' values of transient-mark-mode. Document handle-shift-selection. * commands.texi (Using Interactive, Interactive Codes): Document `^'. (Interactive Examples): Show an example of `^'. (Key Sequence Input): Document this-command-keys-shift-translated. + (Defining Commands, Using Interactive): The interactive-form of a + function can be added via its symbol's property. * positions.texi (List Motion): beginning-of-defun-function can now accept an argument. diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 9928379e82f..2fa2268a095 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -103,7 +103,8 @@ command does. @cindex interactive function A Lisp function becomes a command when its body contains, at top -level, a form that calls the special form @code{interactive}. This +level, a form that calls the special form @code{interactive}, or if +the function's symbol has an @code{interactive-form} property. This form does nothing when actually executed, but its presence serves as a flag to indicate that interactive calling is permitted. Its argument controls the reading of arguments for an interactive call. @@ -141,6 +142,11 @@ the function is called, all its body forms including the @code{interactive} form are executed, but at this time @code{interactive} simply returns @code{nil} without even evaluating its argument. + +@cindex @code{interactive-form}, function property +An interactive form can be added to a function post-facto via the +@code{interactive-form} property of the function's symbol. +@xref{Symbol Plists}. @end defspec There are three possibilities for the argument @var{arg-descriptor}: diff --git a/etc/NEWS b/etc/NEWS index cf9d2866d5a..573a56ab0a0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1169,10 +1169,12 @@ undefined functions. handle-shift-selection if shift-select-mode is non-nil, before reading the command arguments. This is used for shift-selection (see above). ++++ *** Built-in functions can now have an interactive specification that is not a prompt string. If the `intspec' parameter of a `DEFUN' starts with a `(', the string is evaluated as a Lisp form. ++++ *** 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.