From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Interactive specs of C functions. Date: Fri, 07 Sep 2007 22:18:48 -0400 Message-ID: References: <87sl5qr093.fsf@cadilhac.name> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1189217941 1577 80.91.229.12 (8 Sep 2007 02:19:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 8 Sep 2007 02:19:01 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 08 04:19:01 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ITpuV-0001Zk-Vv for ged-emacs-devel@m.gmane.org; Sat, 08 Sep 2007 04:19:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITpuT-00085X-BI for ged-emacs-devel@m.gmane.org; Fri, 07 Sep 2007 22:18:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ITpuQ-00084y-0s for emacs-devel@gnu.org; Fri, 07 Sep 2007 22:18:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ITpuO-00084M-1q for emacs-devel@gnu.org; Fri, 07 Sep 2007 22:18:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITpuN-00084G-Px for emacs-devel@gnu.org; Fri, 07 Sep 2007 22:18:51 -0400 Original-Received: from tomts13.bellnexxia.net ([209.226.175.34] helo=tomts13-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ITpuN-0001fN-5H for emacs-devel@gnu.org; Fri, 07 Sep 2007 22:18:51 -0400 Original-Received: from ceviche.home ([70.55.141.227]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070908021848.GSZ13659.tomts13-srv.bellnexxia.net@ceviche.home> for ; Fri, 7 Sep 2007 22:18:48 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 895C070082; Fri, 7 Sep 2007 22:18:48 -0400 (EDT) In-Reply-To: ("Johan =?iso-8859-1?Q?Bockg=E5rd=22's?= message of "Fri\, 07 Sep 2007 23\:52\:39 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Detected-Kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:78211 Archived-At: >> ** 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. */