all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Interactive specs of C functions.
Date: Fri, 07 Sep 2007 22:18:48 -0400	[thread overview]
Message-ID: <jwv642lzyt9.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <yoijveam9m8o.fsf@gamma02.me.chalmers.se> ("Johan Bockgård"'s message of "Fri\, 07 Sep 2007 23\:52\:39 +0200")

>> ** 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	other threads:[~2007-09-08  2:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-07 14:58 Interactive specs of C functions Michaël Cadilhac
2007-09-07 18:01 ` Stefan Monnier
2007-09-07 21:52   ` Johan Bockgård
2007-09-08  2:18     ` Stefan Monnier [this message]
2007-09-08 19:48       ` Richard Stallman
2007-09-09 20:45         ` Stefan Monnier
2007-09-10  1:13           ` Richard Stallman
2007-09-10  2:29             ` Stefan Monnier
2007-09-12 23:59               ` Johan Bockgård
2007-09-08  7:01 ` Richard Stallman
2007-09-08  9:06   ` Michaël Cadilhac
     [not found]     ` <E1IUCIK-0008Ck-2z@fencepost.gnu.org>
2007-09-09 20:46       ` Michaël Cadilhac
2007-09-09 21:19         ` Stefan Monnier
2007-09-09 22:34           ` Michaël Cadilhac
2007-09-10  1:13             ` Richard Stallman
2007-09-10 11:06               ` Michaël Cadilhac
2007-09-10 14:52                 ` Dan Nicolaescu
2007-09-10 15:05                   ` Michaël Cadilhac
2007-09-10 15:13                     ` Dan Nicolaescu
2007-09-10 15:27                       ` Michaël Cadilhac
2007-09-10 15:39                         ` Dan Nicolaescu
2007-09-10 15:55                           ` Michaël Cadilhac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv642lzyt9.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.