From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#53910: [External] : bug#53910: 29.0.50; context-menu-mode breaks help in read-only buffers Date: Thu, 17 Feb 2022 21:30:13 +0200 Organization: LINKOV.NET Message-ID: <868ru9jnp6.fsf@mail.linkov.net> References: <20220210001600.vjiuqzoiuuzzj54c.ref@Ergus> <20220210001600.vjiuqzoiuuzzj54c@Ergus> <87mtizdwrv.fsf@gnus.org> <86y22jxfsq.fsf@mail.linkov.net> <87o83f7y3x.fsf@gnus.org> <86iltmpn0a.fsf@mail.linkov.net> <86wni13ifi.fsf@mail.linkov.net> <86pmns10kw.fsf@mail.linkov.net> <5d2c2af9-d011-583b-e9c1-985bbc2378c2@gmx.at> <861r06vbos.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10378"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , Ergus , "53910@debbugs.gnu.org" <53910@debbugs.gnu.org> To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 17 20:32:39 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKmW6-0002Wn-U6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Feb 2022 20:32:38 +0100 Original-Received: from localhost ([::1]:54428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKmW5-0002Fj-Hq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Feb 2022 14:32:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKmVc-0002EY-KL for bug-gnu-emacs@gnu.org; Thu, 17 Feb 2022 14:32:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58819) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKmVW-00069p-29 for bug-gnu-emacs@gnu.org; Thu, 17 Feb 2022 14:32:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nKmVV-0001Yx-RA for bug-gnu-emacs@gnu.org; Thu, 17 Feb 2022 14:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Feb 2022 19:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53910 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 53910-submit@debbugs.gnu.org id=B53910.16451263175997 (code B ref 53910); Thu, 17 Feb 2022 19:32:01 +0000 Original-Received: (at 53910) by debbugs.gnu.org; 17 Feb 2022 19:31:57 +0000 Original-Received: from localhost ([127.0.0.1]:52716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKmVR-0001Yf-JG for submit@debbugs.gnu.org; Thu, 17 Feb 2022 14:31:57 -0500 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:48411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKmVO-0001YP-SY for 53910@debbugs.gnu.org; Thu, 17 Feb 2022 14:31:56 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 516B840005; Thu, 17 Feb 2022 19:31:44 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Thu, 17 Feb 2022 14:13:59 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:227114 Archived-At: >> (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. I know, but there are too many problems when help functions are trying to build the context menu in a non-displayed buffer. Is there another way to prevent this? Recently this was changed: - `(menu-item ,(purecopy "Context Menu") ignore + `(menu-item ,(purecopy "Context Menu") ,(make-sparse-keymap) to prevent where-is-internal from running context-menu-map by describe-mode in the wrong buffer, but this was not enough. >> 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 )) is what > you're after. Maybe (kill-buffer (window-buffer )) has the same effect when used in any window, but (bury-buffer (window-buffer )) definitely should be called in the required window, because `bury-buffer` uses `nil` for the WINDOW args, e.g.: (set-window-dedicated-p nil nil) (switch-to-prev-buffer nil 'bury)