unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* what does (interactive "P") do?
@ 2002-11-20 22:20 seberino
  0 siblings, 0 replies; 3+ messages in thread
From: seberino @ 2002-11-20 22:20 UTC (permalink / raw)


I just saw (interactive "P") in a .emacs and
wondered what it did.  I assume (interactive)
lets a user run a function v. just being
run from another function.

What extra functiononality does the "P" give you?

Chris
-- 
_______________________________________

Dr. Christian Seberino
SPAWAR Systems Center San Diego
Code 2363
49590 Lassing Road, Room A339
San Diego, CA 92152-6147
U.S.A.

Phone: (619) 553-7940
Fax:   (619) 553-1269
Email: seberino@spawar.navy.mil
_______________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: what does (interactive "P") do?
       [not found] <mailman.1037830920.29858.help-gnu-emacs@gnu.org>
@ 2002-11-20 23:33 ` Michael Slass
  2002-11-20 23:40 ` Oliver Scholz
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Slass @ 2002-11-20 23:33 UTC (permalink / raw)


seberino@spawar.navy.mil writes:

>I just saw (interactive "P") in a .emacs and
>wondered what it did.  I assume (interactive)
>lets a user run a function v. just being
>run from another function.
>
>What extra functiononality does the "P" give you?
>
>Chris
>-- 

You have just crossed the threshold in your lisp programming
sophistication where the manual is a must.  Go get the elisp-intro and
elisp manuals from www.fsf.org.  They're available in info format,
which means that you can read them from within emacs, and evaluate
(execute) the samples as you go.

-- 
Mike Slass

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: what does (interactive "P") do?
       [not found] <mailman.1037830920.29858.help-gnu-emacs@gnu.org>
  2002-11-20 23:33 ` Michael Slass
@ 2002-11-20 23:40 ` Oliver Scholz
  1 sibling, 0 replies; 3+ messages in thread
From: Oliver Scholz @ 2002-11-20 23:40 UTC (permalink / raw)


seberino@spawar.navy.mil writes:

> I just saw (interactive "P") in a .emacs and
> wondered what it did.  I assume (interactive)
> lets a user run a function v. just being
> run from another function.

It declares that the function is a command. That is, a user may run it
via M-x and it may be bound to a keystroke.

> What extra functiononality does the "P" give you?

With "P" in the spec string of `interactive' the prefix (`C-u ...') is
passed in raw form as an argument to the function. It is typically
used in forms like

(my-fancy-function (prefix)
  (interactive "P")
  ...
  (if (prefix)
      (do-something)
    (do-something-different))
   ...)

See `C-h f interactive RET' for a complete list of code letters for
`interactive'.

    Oliver
-- 
1 Frimaire an 211 de la Révolution
Liberté, Egalité, Fraternité!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-11-20 23:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-20 22:20 what does (interactive "P") do? seberino
     [not found] <mailman.1037830920.29858.help-gnu-emacs@gnu.org>
2002-11-20 23:33 ` Michael Slass
2002-11-20 23:40 ` Oliver Scholz

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