emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: interactive?


From: tomas
Subject: Re: interactive?
Date: Mon, 18 Jan 2010 15:00:48 +0100
User-agent: Mutt/1.5.15+20070412 (2007-04-11)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]