Subject: bug#51173: 28.0.60; gnus-article-describe-key doesn't work

From: Stefan Monnier <[email-masked]>
Date: Wed, 13 Oct 2021 16:01:51 -0400

>> I think this is mea culpa - commit 2d1564103e.
>> It was changed to handle context menu clicks
>> in the displayed window.
>
> This patch should handle only mouse events specially:
>
> diff --git a/lisp/help.el b/lisp/help.el
> index fa4eaee417..956a3d0d32 100644
> --- a/lisp/help.el
> +++ b/lisp/help.el
> @@ -699,7 +699,10 @@ help--analyze-key
>           ;; is selected from the context menu that should describe KEY
>           ;; at the position of mouse click that opened the context menu.
>           ;; When no mouse was involved, it defaults to window-point.
> -	 (defn (save-excursion (mouse-set-point event) (key-binding key t))))
> +         (defn (if (consp event)
> +                   (save-excursion
> +                     (mouse-set-point event) (key-binding key t))
> +                 (key-binding key t))))
>      ;; Handle the case where we faked an entry in "Select and Paste" menu.
>      (when (and (eq defn nil)
>  	       (stringp (aref key (1- (length key))))

But this will still use "the wrong buffer" for mouse clicks, no?

BTW, maybe a cleaner fix would be as follows:
- Add a `buffer` argument to `describe-key(-briefly)`.
- Pass that argument from `gnus-article-describe-key`.
And to get the behavior that Juri just pushed that `buffer` argument
would default to (if (consp event) (window-buffer (posn-window
(event-start event))) (current-buffere)).

        Stefan