diff options
| author | Richard M. Stallman | 1994-12-28 23:28:10 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-12-28 23:28:10 +0000 |
| commit | ef2515c0517f8045c26a27c4319aac606bad42fa (patch) | |
| tree | 07394676c261654d91f4590b5c7f6af5be52e19c /src | |
| parent | 9629ced85f2ca2026aa6bdfbe425ee51cb821a0b (diff) | |
| download | emacs-ef2515c0517f8045c26a27c4319aac606bad42fa.tar.gz emacs-ef2515c0517f8045c26a27c4319aac606bad42fa.zip | |
(Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook): New variables.
(syms_of_callint): Set them up.
(Fcall_interactively): Run the hook, for `@'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/callint.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/callint.c b/src/callint.c index b2efb64f6ed..d8e48752b76 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -39,6 +39,8 @@ Lisp_Object Qenable_recursive_minibuffers; | |||
| 39 | even if mark_active is 0. */ | 39 | even if mark_active is 0. */ |
| 40 | Lisp_Object Vmark_even_if_inactive; | 40 | Lisp_Object Vmark_even_if_inactive; |
| 41 | 41 | ||
| 42 | Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; | ||
| 43 | |||
| 42 | Lisp_Object Qlist; | 44 | Lisp_Object Qlist; |
| 43 | Lisp_Object preserved_fns; | 45 | Lisp_Object preserved_fns; |
| 44 | 46 | ||
| @@ -336,6 +338,11 @@ Otherwise, this is done only if an arg is read using the minibuffer.") | |||
| 336 | if (MINI_WINDOW_P (XWINDOW (event)) | 338 | if (MINI_WINDOW_P (XWINDOW (event)) |
| 337 | && ! (minibuf_level > 0 && EQ (event, minibuf_window))) | 339 | && ! (minibuf_level > 0 && EQ (event, minibuf_window))) |
| 338 | error ("Attempt to select inactive minibuffer window"); | 340 | error ("Attempt to select inactive minibuffer window"); |
| 341 | |||
| 342 | /* If the current buffer wants to clean up, let it. */ | ||
| 343 | if (!NILP (Vmouse_leave_buffer_hook)) | ||
| 344 | call1 (Vrun_hooks, Qmouse_leave_buffer_hook); | ||
| 345 | |||
| 339 | Fselect_window (event); | 346 | Fselect_window (event); |
| 340 | } | 347 | } |
| 341 | string++; | 348 | string++; |
| @@ -639,6 +646,9 @@ syms_of_callint () | |||
| 639 | Qenable_recursive_minibuffers = intern ("enable-recursive-minibuffers"); | 646 | Qenable_recursive_minibuffers = intern ("enable-recursive-minibuffers"); |
| 640 | staticpro (&Qenable_recursive_minibuffers); | 647 | staticpro (&Qenable_recursive_minibuffers); |
| 641 | 648 | ||
| 649 | Qmouse_leave_buffer_hook = intern ("mouse-leave-buffer-hook"); | ||
| 650 | staticpro (&Qmouse_leave_buffer_hook); | ||
| 651 | |||
| 642 | DEFVAR_LISP ("prefix-arg", &Vprefix_arg, | 652 | DEFVAR_LISP ("prefix-arg", &Vprefix_arg, |
| 643 | "The value of the prefix argument for the next editing command.\n\ | 653 | "The value of the prefix argument for the next editing command.\n\ |
| 644 | It may be a number, or the symbol `-' for just a minus sign as arg,\n\ | 654 | It may be a number, or the symbol `-' for just a minus sign as arg,\n\ |
| @@ -678,6 +688,12 @@ turns off region highlighting, but commands that use the mark\n\ | |||
| 678 | behave as if the mark were still active."); | 688 | behave as if the mark were still active."); |
| 679 | Vmark_even_if_inactive = Qnil; | 689 | Vmark_even_if_inactive = Qnil; |
| 680 | 690 | ||
| 691 | DEFVAR_LISP ("mouse-leave-buffer-hook", &Vmouse_leave_buffer_hook, | ||
| 692 | "Hook to run when about to switch windows with a mouse command.\n\ | ||
| 693 | Its purpose is to give temporary modes such as Isearch mode\n\ | ||
| 694 | a way to turn themselves off when a mouse command switches windows."); | ||
| 695 | Vmouse_leave_buffer_hook = Qnil; | ||
| 696 | |||
| 681 | defsubr (&Sinteractive); | 697 | defsubr (&Sinteractive); |
| 682 | defsubr (&Scall_interactively); | 698 | defsubr (&Scall_interactively); |
| 683 | defsubr (&Sprefix_numeric_value); | 699 | defsubr (&Sprefix_numeric_value); |