From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.emacs.devel Subject: Re: interactive? Date: Mon, 18 Jan 2010 15:00:48 +0100 Message-ID: <20100118140048.GA26135@tomas> References: <27210523.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1263823390 4118 80.91.229.12 (18 Jan 2010 14:03:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Jan 2010 14:03:10 +0000 (UTC) Cc: Emacs-devel@gnu.org To: "alin.s" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 18 15:03:01 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 1NWsC3-0006oI-LT for ged-emacs-devel@m.gmane.org; Mon, 18 Jan 2010 15:02:59 +0100 Original-Received: from localhost ([127.0.0.1]:41312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWsC4-00008n-Oy for ged-emacs-devel@m.gmane.org; Mon, 18 Jan 2010 09:03:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWsBs-000056-Tj for emacs-devel@gnu.org; Mon, 18 Jan 2010 09:02:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWsBo-0008Tx-Fc for Emacs-devel@gnu.org; Mon, 18 Jan 2010 09:02:48 -0500 Original-Received: from [199.232.76.173] (port=56454 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWsBo-0008Tq-D8 for Emacs-devel@gnu.org; Mon, 18 Jan 2010 09:02:44 -0500 Original-Received: from alextrapp1.equinoxe.de ([217.22.192.104]:54468 helo=www.elogos.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NWsBn-0003Jc-Hl for Emacs-devel@gnu.org; Mon, 18 Jan 2010 09:02:43 -0500 Original-Received: by www.elogos.de (Postfix, from userid 1000) id 084EB90055; Mon, 18 Jan 2010 15:00:49 +0100 (CET) Content-Disposition: inline In-Reply-To: <27210523.post@talk.nabble.com> User-Agent: Mutt/1.5.15+20070412 (2007-04-11) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:120202 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, Jan 18, 2010 at 05:32:02AM -0800, alin.s wrote: >=20 > I do not understand the use of (interactive ) >=20 > (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). You need to declare a function interactive if you want to bind it to a menu or key. Besides that, it will still behave as a normal function. Regards - -- tom=C3=A1s -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFLVGmQBcgs9XrR2kYRAlk+AJ9NNhXMuycxz0jWYsSK7gP84TzJOwCffbkU IT9VC9snV+nJGoTD53d3Ibo=3D =3D8z9j -----END PGP SIGNATURE-----