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: Fri, 07 Sep 2007 22:18:48 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

>> ** 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.

> The current implementation doesn't work for subrs/compiled functions
> though.


> [Fcall_interactively]

>     if (SUBRP (fun))
>         ...
>     else if (COMPILEDP (fun))
>         ...
>     else
>         <---- `Finteractive_form' is only called on this branch

Indeed.  How 'bout the patch below?


        Stefan


--- orig/src/callint.c
+++ mod/src/callint.c
@@ -331,22 +331,6 @@
   /* Decode the kind of function.  Either handle it and return,
      or go to `lose' if not interactive, or set either STRING or SPECS.  */
 
-  if (SUBRP (fun))
-    {
-      string = (unsigned char *) XSUBR (fun)->prompt;
-      if (!string)
-       {
-       lose:
-         wrong_type_argument (Qcommandp, function);
-       }
-    }
-  else if (COMPILEDP (fun))
-    {
-      if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_INTERACTIVE)
-       goto lose;
-      specs = AREF (fun, COMPILED_INTERACTIVE);
-    }
-  else
     {
       Lisp_Object form;
       GCPRO2 (function, prefix_arg);
@@ -355,7 +339,7 @@
       if (CONSP (form))
        specs = filter_specs = Fcar (XCDR (form));
       else
-       goto lose;
+      wrong_type_argument (Qcommandp, function);
     }
 
   /* If either SPECS or STRING is set to a string, use it.  */




reply via email to

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