diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-12-28 23:28:10 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-12-28 23:28:10 +0000 |
commit | ef2515c0517f8045c26a27c4319aac606bad42fa (patch) | |
tree | 07394676c261654d91f4590b5c7f6af5be52e19c /src/callint.c | |
parent | 9629ced85f2ca2026aa6bdfbe425ee51cb821a0b (diff) | |
download | emacs-ef2515c0517f8045c26a27c4319aac606bad42fa.tar.gz emacs-ef2515c0517f8045c26a27c4319aac606bad42fa.tar.bz2 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/callint.c')
-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; even if mark_active is 0. */ Lisp_Object Vmark_even_if_inactive; +Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; + Lisp_Object Qlist; Lisp_Object preserved_fns; @@ -336,6 +338,11 @@ Otherwise, this is done only if an arg is read using the minibuffer.") if (MINI_WINDOW_P (XWINDOW (event)) && ! (minibuf_level > 0 && EQ (event, minibuf_window))) error ("Attempt to select inactive minibuffer window"); + + /* If the current buffer wants to clean up, let it. */ + if (!NILP (Vmouse_leave_buffer_hook)) + call1 (Vrun_hooks, Qmouse_leave_buffer_hook); + Fselect_window (event); } string++; @@ -639,6 +646,9 @@ syms_of_callint () Qenable_recursive_minibuffers = intern ("enable-recursive-minibuffers"); staticpro (&Qenable_recursive_minibuffers); + Qmouse_leave_buffer_hook = intern ("mouse-leave-buffer-hook"); + staticpro (&Qmouse_leave_buffer_hook); + DEFVAR_LISP ("prefix-arg", &Vprefix_arg, "The value of the prefix argument for the next editing command.\n\ 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\ behave as if the mark were still active."); Vmark_even_if_inactive = Qnil; + DEFVAR_LISP ("mouse-leave-buffer-hook", &Vmouse_leave_buffer_hook, + "Hook to run when about to switch windows with a mouse command.\n\ +Its purpose is to give temporary modes such as Isearch mode\n\ +a way to turn themselves off when a mouse command switches windows."); + Vmouse_leave_buffer_hook = Qnil; + defsubr (&Sinteractive); defsubr (&Scall_interactively); defsubr (&Sprefix_numeric_value); |