emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interactive hat. [Was: CUA-like stuff spuriously enables transient-


From: Juanma Barranquero
Subject: Re: Interactive hat. [Was: CUA-like stuff spuriously enables transient-mark-mode]
Date: Wed, 25 Mar 2009 17:41:01 +0100

On Wed, Mar 25, 2009 at 15:19, Alan Mackenzie <address@hidden> wrote:

> I don't think so.  `interactive-form' is a DEFUN (in data.c) which hoiks
> the interactive string out of three different places for three different
> sorts of defun.

I don't think I'm understanding you. I'm talking about the
`interactive-form' symbol property, not the `interactive-form'
function. I.e.:

     The `interactive' form must be located at top-level in the
     function body, or in the function symbol's `interactive-form'
     property (*note Symbol Plists::).  It has its effect because the
     command loop looks for it before calling the function (*note
     Interactive Call::).  Once the function is called, all its body
     forms are executed; at this time, if the `interactive' form occurs
     within the body, the form simply returns `nil' without even
     evaluating its argument.

ELISP> (defun test (&optional arg) (message "Arg = %S" arg))
test
ELISP> (commandp 'test)
nil
ELISP> (put 'test 'interactive-form '(interactive "p"))
(interactive "p")

ELISP> (commandp 'test)
t
ELISP> (call-interactively #'test)
"Arg = 1"
ELISP>

> There's currently no `put-interactive-form', but
> there's no reason why one couldn't be written.

What does that gain over (put SYMBOL 'interactive-form INTERACTIVE-SPEC) ?

    Juanma




reply via email to

[Prev in Thread] Current Thread [Next in Thread]