[Top][All Lists]

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

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

From: Alan Mackenzie
Subject: Re: Interactive hat. [Was: CUA-like stuff spuriously enables transient-mark-mode]
Date: Thu, 26 Mar 2009 12:44:53 +0000
User-agent: Mutt/1.5.9i

Hi, Juanma,

On Wed, Mar 25, 2009 at 05:41:01PM +0100, Juanma Barranquero wrote:
> 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.

Sorry, I wasn't aware of this property.  It does indeed work, but ONLY
in Emacs 23.

[ .... ]

> > 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) ?

The source for such a function, `put-interactive-form' assuming we could
write it in lisp, could be printed in the elisp manual (page "Using
Interactive"), and the maintainer of Foo Mode encouraged to copy it into
her package and use it to maintain compatibility with older Emacsen and
XEmacs, thusly:

    (defun foo-forward-blag (arg)
      "Move forward to the end of the current blag, ...."
      (interactive "^P") .....)
    (if (not emacs-23) (put-interactive-form 'foo-forward-blag "P"))

Alternatively, we could recommend package maintainers not to use "^"
directly in interactive strings, instead only putting them in the
`interactive-form' property.  But this kind of makes the "^" look
contrived and kludgey.

If we're going to be keeping interactive-hat, I think we definitely need
some sort of warning to package maintainers to be careful with it, and we
should offer them a recipe for maintaining compatibility.

>     Juanma

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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