From 3094c12c45a60203052fc1fac1b793b982cdd787 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 19 Jul 2021 16:41:54 +0200 Subject: [PATCH] Fix documentation of mouse-leave-buffer-hook * doc/lispref/hooks.texi (Standard Hooks): Ditto. * src/callint.c (syms_of_callint): Document the actual usage of `mouse-leave-buffer-hook' (bug#2932). --- doc/lispref/hooks.texi | 2 +- src/callint.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi index b1c7e613719..394928454b0 100644 --- a/doc/lispref/hooks.texi +++ b/doc/lispref/hooks.texi @@ -184,7 +184,7 @@ The command loop runs this soon after @code{post-command-hook} (q.v.). @item mouse-leave-buffer-hook @vindex mouse-leave-buffer-hook -Hook run when about to switch windows with a mouse command. +Hook run when the user mouse-clicks in a window. @item mouse-position-function @xref{Mouse Position}. diff --git a/src/callint.c b/src/callint.c index 18624637843..a196210250d 100644 --- a/src/callint.c +++ b/src/callint.c @@ -892,7 +892,10 @@ behave as if the mark were still active. */); Vmark_even_if_inactive = Qt; DEFVAR_LISP ("mouse-leave-buffer-hook", Vmouse_leave_buffer_hook, - doc: /* Hook to run when about to switch windows with a mouse command. + doc: /* Hook run when the user mouse-clicks in a window. +It can be run both before and after switching windows, or even when +when not actually switching windows. + Its purpose is to give temporary modes such as Isearch mode a way to turn themselves off when a mouse command switches windows. */); Vmouse_leave_buffer_hook = Qnil; -- 2.39.2