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: Sun, 09 Sep 2007 16:45:45 -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 1189373004 10738 80.91.229.12 (9 Sep 2007 21:23:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2007 21:23:24 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 10 07:23:11 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 1IUb9d-0004pn-3d for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2007 06:45:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUTfG-0006my-Lg for ged-emacs-devel@m.gmane.org; Sun, 09 Sep 2007 16:45:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IUTfC-0006io-N2 for emacs-devel@gnu.org; Sun, 09 Sep 2007 16:45:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IUTfB-0006h4-OP for emacs-devel@gnu.org; Sun, 09 Sep 2007 16:45:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUTfB-0006gj-JN for emacs-devel@gnu.org; Sun, 09 Sep 2007 16:45:49 -0400 Original-Received: from tomts40.bellnexxia.net ([209.226.175.97] helo=tomts40-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IUTf8-0000aV-El; Sun, 09 Sep 2007 16:45:46 -0400 Original-Received: from pastel.home ([70.55.141.227]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070909204545.FOII29719.tomts40-srv.bellnexxia.net@pastel.home>; Sun, 9 Sep 2007 16:45:45 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 505628073; Sun, 9 Sep 2007 16:45:45 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Sat\, 08 Sep 2007 15\:48\:01 -0400") 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:78349 Archived-At: > 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