emacs-devel
[Top][All Lists]
Advanced

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

Re: Interactive specs of C functions.


From: Stefan Monnier
Subject: Re: Interactive specs of C functions.
Date: Sun, 09 Sep 2007 16:45:45 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

>     Indeed.  How 'bout the patch below?
>     -  if (SUBRP (fun))
>     -    {
>     -      string = (unsigned char *) XSUBR (fun)->prompt;
>     -      if (!string)
>     - {
>     - lose:
>     -   wrong_type_argument (Qcommandp, function);
>     - }

> That would be a slowdown in very important cases.

Finteractive_form takes an absolutely negligible amount of time.  So I have
no idea what you mean by "a slowdown".  The only "problem" I could imagine
is that Finteractive_form allocates a Lisp string whereas the above code
doesn't.  It's easy to work around it: make an `interactive_form' function
(used by Finteractive_form') which takes an additional char** argument into
which it can return the C string so as to avoid allocating the Lisp string
when called from Fcall_interactively.

> It would be better to keep that code, but have it fall through when it
> doesn't find an interactive string in the special way, into the
> general case.

That would prevent overriding a pre-existing interactive form.


        Stefan




reply via email to

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