unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: tomas@tuxteam.de
To: "alin.s" <alinsoar@voila.fr>
Cc: Emacs-devel@gnu.org
Subject: Re: interactive?
Date: Mon, 18 Jan 2010 15:00:48 +0100	[thread overview]
Message-ID: <20100118140048.GA26135@tomas> (raw)
In-Reply-To: <27210523.post@talk.nabble.com>

-----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).

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ás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFLVGmQBcgs9XrR2kYRAlk+AJ9NNhXMuycxz0jWYsSK7gP84TzJOwCffbkU
IT9VC9snV+nJGoTD53d3Ibo=
=8z9j
-----END PGP SIGNATURE-----




  parent reply	other threads:[~2010-01-18 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-18 13:32 interactive? alin.s
2010-01-18 13:44 ` interactive? Andreas Schwab
2010-01-18 14:03   ` interactive? alin.s
2010-01-18 14:00 ` tomas [this message]
2010-01-18 14:10   ` interactive? alin.s

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20100118140048.GA26135@tomas \
    --to=tomas@tuxteam.de \
    --cc=Emacs-devel@gnu.org \
    --cc=alinsoar@voila.fr \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).