unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: martin rudalics <rudalics@gmx.at>,
	Lars Ingebrigtsen <larsi@gnus.org>, Ergus <spacibba@aol.com>,
	Drew Adams <drew.adams@oracle.com>,
	"53910@debbugs.gnu.org" <53910@debbugs.gnu.org>
Subject: bug#53910: [External] : bug#53910: 29.0.50; context-menu-mode breaks help in read-only buffers
Date: Thu, 17 Feb 2022 15:12:36 -0500	[thread overview]
Message-ID: <jwv1r011cnn.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <868ru9jnp6.fsf@mail.linkov.net> (Juri Linkov's message of "Thu,  17 Feb 2022 21:30:13 +0200")

>>>  (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.

Those are bugs in the context-menu functions that need to be fixed
because they'll bite us sooner or later in other cases anyway.
In a sense, we should be happy to have such an easy way to trigger those
bugs ;-)

> Is there another way to prevent this?

I think a slightly cleaner way (if you want to keep such a workaround
rather than chase&fix the underlying bugs) is to move the var to
`mouse.el` and call it `inhibit-context-menu`, and then let-bind at the
appropriate place with a prominent comment explaining why we're using
such a hack.

> Maybe (kill-buffer (window-buffer <WINDOW>)) has the same effect
> when used in any window, but (bury-buffer (window-buffer <WINDOW>))
> definitely should be called in the required window,

Indeed, there are several function that need the right `selected-window`
and where you can't pass an explicit window instead, and `bury-buffer`
is one of them.


        Stefan






  reply	other threads:[~2022-02-17 20:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220210001600.vjiuqzoiuuzzj54c.ref@Ergus>
2022-02-10  0:16 ` bug#53910: 29.0.50; context-menu-mode breaks help in read-only buffers Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-10  7:08   ` Lars Ingebrigtsen
2022-02-10  8:54     ` Juri Linkov
2022-02-10 11:35       ` Lars Ingebrigtsen
2022-02-10 18:58         ` Juri Linkov
2022-02-11  8:31           ` martin rudalics
2022-02-11  8:40             ` Juri Linkov
2022-02-11 16:46               ` bug#53910: [External] : " Drew Adams
2022-02-12 17:05                 ` Juri Linkov
2022-02-13  8:49                   ` martin rudalics
2022-02-13 18:50                     ` Juri Linkov
2022-02-17 19:13                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-17 19:30                         ` Juri Linkov
2022-02-17 20:12                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-02-18  7:44                             ` Juri Linkov
2022-02-18  8:32                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-20 18:56                                 ` Juri Linkov
2022-02-19  9:41                           ` martin rudalics
2022-02-19 12:26                             ` Eli Zaretskii
2022-02-19 17:07                               ` martin rudalics
2022-02-19 17:22                                 ` Eli Zaretskii
2022-02-20  9:16                                   ` martin rudalics
2022-02-20 18:44                                     ` Juri Linkov
2022-02-21  9:07                                       ` martin rudalics
2022-02-22 17:10                                         ` Juri Linkov
2022-02-23  9:29                                           ` martin rudalics
2022-02-19 14:38                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-20  9:14                               ` martin rudalics
2022-02-20 14:42                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-10  8:26   ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv1r011cnn.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=53910@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rudalics@gmx.at \
    --cc=spacibba@aol.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).