Subject: Re: bug#53910: [External] : bug#53910: 29.0.50; context-menu-mode breaks help in read-only buffers

From: Stefan Monnier <[email-masked]>
Date: Thu, 17 Feb 2022 14:13:59 -0500

> --- a/lisp/mouse.el
> +++ b/lisp/mouse.el
> @@ -541,7 +541,9 @@ context-menu-ffap
>  
>  (defvar context-menu-entry
>    `(menu-item ,(purecopy "Context Menu") ,(make-sparse-keymap)
> -              :filter ,(lambda (_) (context-menu-map)))
> +              :filter ,(lambda (_) (unless help-buffer-under-preparation
> +                                     ;; No need to build menu to describe keys
> +                                     (context-menu-map))))
>    "Menu item that creates the context menu and can be bound to a mouse key.")

FWIW, I find this hideous.  `mouse.el` should not depend on `help-*` variables.

> While it's possible to use the 'window' argument in all functions used
> in window-safely-shrinkable-p, tab-line functions use functions that
> don't accept the 'window' argument, e.g. current-buffer, kill-buffer.

`window-buffer` is the function that returns the "current" buffer of a
window.  As for `kill-buffer`, I'm not sure what window arg you'd like
to use by I suspect (kill-buffer (window-buffer <WINDOW>)) is what
you're after.

        Stefan