aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorChong Yidong2009-08-15 21:51:33 +0000
committerChong Yidong2009-08-15 21:51:33 +0000
commit84b17ab096ecd55c381fb7b00ab5b324fedb477b (patch)
treea1eb5bf7f35e751a9f1e7eb791348c03dc89714c /src/eval.c
parent89a9e058e25a25e8838aee4c27c4fa88550cc0f9 (diff)
downloademacs-84b17ab096ecd55c381fb7b00ab5b324fedb477b.tar.gz
emacs-84b17ab096ecd55c381fb7b00ab5b324fedb477b.zip
* eval.c (Fcalled_interactively_p, Finteractive_p): Doc
fix (Bug#3936).
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/eval.c b/src/eval.c
index 52e3f244047..3427d0f8573 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -586,10 +586,10 @@ usage: (function ARG) */)
586 586
587 587
588DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0, 588DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0,
589 doc: /* Return t if the function was run directly by user input. 589 doc: /* Return t if the containing function was run directly by user input.
590This means that the function was called with `call-interactively' 590This means that the function was called with `call-interactively'
591\(which includes being called as the binding of a key) 591\(which includes being called as the binding of a key)
592and input is currently coming from the keyboard (not in keyboard macro), 592and input is currently coming from the keyboard (not a keyboard macro),
593and Emacs is not running in batch mode (`noninteractive' is nil). 593and Emacs is not running in batch mode (`noninteractive' is nil).
594 594
595The only known proper use of `interactive-p' is in deciding whether to 595The only known proper use of `interactive-p' is in deciding whether to
@@ -598,10 +598,10 @@ of using it for any other purpose, it is quite likely that you're
598making a mistake. Think: what do you want to do when the command is 598making a mistake. Think: what do you want to do when the command is
599called from a keyboard macro? 599called from a keyboard macro?
600 600
601If you want to test whether your function was called with 601To test whether your function was called with `call-interactively',
602`call-interactively', the way to do that is by adding an extra 602either (i) add an extra optional argument and give it an `interactive'
603optional argument, and making the `interactive' spec specify non-nil 603spec that specifies non-nil unconditionally (such as \"p\"); or (ii)
604unconditionally for that argument. (`p' is a good way to do this.) */) 604use `called-interactively-p'. */)
605 () 605 ()
606{ 606{
607 return (INTERACTIVE && interactive_p (1)) ? Qt : Qnil; 607 return (INTERACTIVE && interactive_p (1)) ? Qt : Qnil;
@@ -609,14 +609,15 @@ unconditionally for that argument. (`p' is a good way to do this.) */)
609 609
610 610
611DEFUN ("called-interactively-p", Fcalled_interactively_p, Scalled_interactively_p, 0, 0, 0, 611DEFUN ("called-interactively-p", Fcalled_interactively_p, Scalled_interactively_p, 0, 0, 0,
612 doc: /* Return t if it is in a function called with `call-interactively'. 612 doc: /* Return t if the containing function was called by `call-interactively'.
613This is used for implementing advice and other function-modifying 613This includes being called as the binding of a key, or called from a
614features of Emacs. 614keyboard macro (unlike `interactive-p').
615 615
616The cleanest way to test whether your function was called with 616This function is meant for implementing advice and other
617`call-interactively' is by adding an extra optional argument, 617function-modifying features. Instead of using this, it is sometimes
618and making the `interactive' spec specify non-nil unconditionally 618cleaner to give your function an extra optional argument whose
619for that argument. (`p' is a good way to do this.) */) 619`interactive' spec specifies non-nil unconditionally (\"p\" is a good
620way to do this). */)
620 () 621 ()
621{ 622{
622 return interactive_p (1) ? Qt : Qnil; 623 return interactive_p (1) ? Qt : Qnil;