Commit c3aaf1d7 authored by Eli Zaretskii's avatar Eli Zaretskii

(Defining Commands, Using Interactive): The interactive-form of a function

can be added via its symbol's property.
parent 2c30e468
2008-10-15 Eli Zaretskii <eliz@gnu.org>
* 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.
......
......@@ -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}:
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment