diff options
| author | Karoly Lorentey | 2004-11-06 17:52:02 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-11-06 17:52:02 +0000 |
| commit | 65ea79492334e2ef7b5b4e0d23b6f68ba2f4d0bb (patch) | |
| tree | 853cf391ca1abda4f4ccd6fe8e7bb43f7c86ee08 /src/eval.c | |
| parent | e0bc17abe6979d607e8de4684dddb96e53c60065 (diff) | |
| parent | 392cf16dd0ee9358f8af0cd0d8048b822456bbeb (diff) | |
| download | emacs-65ea79492334e2ef7b5b4e0d23b6f68ba2f4d0bb.tar.gz emacs-65ea79492334e2ef7b5b4e0d23b6f68ba2f4d0bb.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-653
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-654
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-655
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-656
Update from CVS: lisp/man.el (Man-xref-normal-file): Fix help-echo.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-657
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-658
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-659
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-660
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-661
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-662
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-663
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-664
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-665
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-666
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-667
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-668
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-669
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-670
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-671
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-64
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-65
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-66
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-67
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-68
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-264
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/src/eval.c b/src/eval.c index ee74215b2ee..5fb35cee58b 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -540,21 +540,45 @@ usage: (function ARG) */) | |||
| 540 | 540 | ||
| 541 | 541 | ||
| 542 | DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0, | 542 | DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0, |
| 543 | doc: /* Return t if function in which this appears was called interactively. | 543 | doc: /* Return t if the function was run directly by user input. |
| 544 | This means that the function was called with call-interactively (which | 544 | This means that the function was called with call-interactively (which |
| 545 | includes being called as the binding of a key) | 545 | includes being called as the binding of a key) |
| 546 | and input is currently coming from the keyboard (not in keyboard macro). */) | 546 | and input is currently coming from the keyboard (not in keyboard macro), |
| 547 | and Emacs is not running in batch mode (`noninteractive' is nil). | ||
| 548 | |||
| 549 | The only known proper use of `interactive-p' is in deciding whether to | ||
| 550 | display a helpful message, or how to display it. If you're thinking | ||
| 551 | of using it for any other purpose, it is quite likely that you're | ||
| 552 | making a mistake. Think: what do you want to do when the command is | ||
| 553 | called from a keyboard macro? | ||
| 554 | |||
| 555 | If you want to test whether your function was called with | ||
| 556 | `call-interactively', the way to do that is by adding an extra | ||
| 557 | optional argument, and making the `interactive' spec specify non-nil | ||
| 558 | unconditionally for that argument. (`p' is a good way to do this.) */) | ||
| 547 | () | 559 | () |
| 548 | { | 560 | { |
| 549 | return interactive_p (1) ? Qt : Qnil; | 561 | return (INTERACTIVE && interactive_p (1)) ? Qt : Qnil; |
| 550 | } | 562 | } |
| 551 | 563 | ||
| 552 | 564 | ||
| 553 | /* Return 1 if function in which this appears was called | 565 | DEFUN ("called-interactively-p", Fcalled_interactively_p, Scalled_interactively_p, 0, 0, 0, |
| 554 | interactively. This means that the function was called with | 566 | doc: /* Return t if the function using this was called with call-interactively. |
| 555 | call-interactively (which includes being called as the binding of | 567 | This is used for implementing advice and other function-modifying |
| 556 | a key) and input is currently coming from the keyboard (not in | 568 | features of Emacs. |
| 557 | keyboard macro). | 569 | |
| 570 | The cleanest way to test whether your function was called with | ||
| 571 | `call-interactively', the way to do that is by adding an extra | ||
| 572 | optional argument, and making the `interactive' spec specify non-nil | ||
| 573 | unconditionally for that argument. (`p' is a good way to do this.) */) | ||
| 574 | () | ||
| 575 | { | ||
| 576 | return (INTERACTIVE && interactive_p (1)) ? Qt : Qnil; | ||
| 577 | } | ||
| 578 | |||
| 579 | |||
| 580 | /* Return 1 if function in which this appears was called using | ||
| 581 | call-interactively. | ||
| 558 | 582 | ||
| 559 | EXCLUDE_SUBRS_P non-zero means always return 0 if the function | 583 | EXCLUDE_SUBRS_P non-zero means always return 0 if the function |
| 560 | called is a built-in. */ | 584 | called is a built-in. */ |
| @@ -566,9 +590,6 @@ interactive_p (exclude_subrs_p) | |||
| 566 | struct backtrace *btp; | 590 | struct backtrace *btp; |
| 567 | Lisp_Object fun; | 591 | Lisp_Object fun; |
| 568 | 592 | ||
| 569 | if (!INTERACTIVE) | ||
| 570 | return 0; | ||
| 571 | |||
| 572 | btp = backtrace_list; | 593 | btp = backtrace_list; |
| 573 | 594 | ||
| 574 | /* If this isn't a byte-compiled function, there may be a frame at | 595 | /* If this isn't a byte-compiled function, there may be a frame at |
| @@ -1975,7 +1996,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, | |||
| 1975 | struct backtrace backtrace; | 1996 | struct backtrace backtrace; |
| 1976 | struct gcpro gcpro1, gcpro2, gcpro3; | 1997 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 1977 | 1998 | ||
| 1978 | if (handling_signal) | 1999 | if (handling_signal || INPUT_BLOCKED_P) |
| 1979 | abort (); | 2000 | abort (); |
| 1980 | 2001 | ||
| 1981 | if (SYMBOLP (form)) | 2002 | if (SYMBOLP (form)) |
| @@ -3449,6 +3470,7 @@ The value the function returns is not used. */); | |||
| 3449 | defsubr (&Scondition_case); | 3470 | defsubr (&Scondition_case); |
| 3450 | defsubr (&Ssignal); | 3471 | defsubr (&Ssignal); |
| 3451 | defsubr (&Sinteractive_p); | 3472 | defsubr (&Sinteractive_p); |
| 3473 | defsubr (&Scalled_interactively_p); | ||
| 3452 | defsubr (&Scommandp); | 3474 | defsubr (&Scommandp); |
| 3453 | defsubr (&Sautoload); | 3475 | defsubr (&Sautoload); |
| 3454 | defsubr (&Seval); | 3476 | defsubr (&Seval); |