From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "alin.s" Newsgroups: gmane.emacs.devel Subject: Re: interactive? Date: Mon, 18 Jan 2010 06:10:28 -0800 (PST) Message-ID: <27210996.post@talk.nabble.com> References: <27210523.post@talk.nabble.com> <20100118140048.GA26135@tomas> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1263823848 5923 80.91.229.12 (18 Jan 2010 14:10:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Jan 2010 14:10:48 +0000 (UTC) To: Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 18 15:10:41 2010 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 1NWsJT-0001by-Kc for ged-emacs-devel@m.gmane.org; Mon, 18 Jan 2010 15:10:39 +0100 Original-Received: from localhost ([127.0.0.1]:57158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWsJU-0004xM-Ht for ged-emacs-devel@m.gmane.org; Mon, 18 Jan 2010 09:10:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWsJP-0004x7-4n for emacs-devel@gnu.org; Mon, 18 Jan 2010 09:10:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWsJK-0004wu-FB for Emacs-devel@gnu.org; Mon, 18 Jan 2010 09:10:34 -0500 Original-Received: from [199.232.76.173] (port=60387 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWsJK-0004wr-99 for Emacs-devel@gnu.org; Mon, 18 Jan 2010 09:10:30 -0500 Original-Received: from kuber.nabble.com ([216.139.236.158]:33016) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NWsJJ-0004Le-Rt for Emacs-devel@gnu.org; Mon, 18 Jan 2010 09:10:30 -0500 Original-Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NWsJI-0004hV-2E for Emacs-devel@gnu.org; Mon, 18 Jan 2010 06:10:28 -0800 In-Reply-To: <20100118140048.GA26135@tomas> X-Nabble-From: alinsoar@voila.fr X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:120204 Archived-At: Tomas Zerolo wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Mon, Jan 18, 2010 at 05:32:02AM -0800, alin.s wrote: >> >> I do not understand the use of (interactive ) >> >> (defun x (n) >> (interactive "P") >> n) > > (See also Andreas' reply) > > One way to look at it is that an interactive function is also a > "command": you, as a user get help to call such a function. For example, > you can call "query-replace-regexp" with M-x query-replace-regexp and > get help with tab-expansion and with parameters (just try), because it > was declared "interactive" (note that the call for interactive has > specifications about how to prompt for the different arguments). > > > This happens because execute-extended-command calls Fcompleting_read with the predicate Qcommandp, in order to limit the results. Only interactive forms are returned: function = Fcompleting_read (build_string (buf), Vobarray, Qcommandp, Qt, Qnil, Qextended_command_history, Qnil, Qnil); You need to declare a function interactive if you want to bind it to a menu or key. Yes, due to the call of commandp inside Fcompleting_read. Besides that, it will still behave as a normal function. Yes, because (interactive) returns null all the time. Now I understand, thank you all. Alin -- View this message in context: http://old.nabble.com/interactive--tp27210523p27210996.html Sent from the Emacs - Dev mailing list archive at Nabble.com.