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#9923: 24.0.91; `where-is' does not find recentf menu items (cmds, not files) Date: Mon, 06 Dec 2021 19:24:47 +0200 Organization: LINKOV.NET Message-ID: <86fsr5zlwg.fsf@mail.linkov.net> References: <76FA3F83D086455EAA01FF0FB000FCDB@us.oracle.com> <871r6hk99k.fsf@gnus.org> <87bl5k2ug1.fsf@gnus.org> <87czpwb4gw.fsf@mail.linkov.net> <8635n753o3.fsf@mail.linkov.net> <8635n613xt.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="10615"; 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: 9923@debbugs.gnu.org, Lars Ingebrigtsen To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 06 18:28:13 2021 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 1muHme-0002XK-8K for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 18:28:12 +0100 Original-Received: from localhost ([::1]:48182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muHmd-00048N-4T for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 12:28:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muHmU-00048F-Pg for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 12:28:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muHmU-0002YQ-Hq for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 12:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1muHmU-00013t-7a for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 12:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Dec 2021 17:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 9923-submit@debbugs.gnu.org id=B9923.16388116444031 (code B ref 9923); Mon, 06 Dec 2021 17:28:02 +0000 Original-Received: (at 9923) by debbugs.gnu.org; 6 Dec 2021 17:27:24 +0000 Original-Received: from localhost ([127.0.0.1]:35302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muHls-00012x-Is for submit@debbugs.gnu.org; Mon, 06 Dec 2021 12:27:24 -0500 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:54845) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muHlq-00012f-JF for 9923@debbugs.gnu.org; Mon, 06 Dec 2021 12:27:23 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id A553840018; Mon, 6 Dec 2021 17:27:14 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Mon, 06 Dec 2021 08:50:49 -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:221770 Archived-At: >>> I think it would be more "obviously correct" if we switched to >>> (window-buffer (posn-window (event-end click))) instead. >> >> Will do this if a simpler solution below is not suitable. > > I think the hunk above (and the one before that) is a good change > regardless of this specific bug: it doesn't make sense to use > `posn-point` without making sure we're in (window-buffer (posn-window ...)). So this fix is pushed to emacs-28. > Hmm... taking a second look at the `mouse.el` file, I think the problem > is rather than the menu-item has an nominal/default/static binding of > `ignore`. So I guess the `:filter` isn't run to try and look for > `ignore` in the dynamically-generated map but instead it's run later > (when `where-is-internal` checks that the binding it found is real). > > So maybe another way to avoid running the filter is with the > patch below. > > --- a/lisp/mouse.el > +++ b/lisp/mouse.el > @@ -513,7 +513,7 @@ context-menu-ffap > menu) > > (defvar context-menu-entry > - `(menu-item ,(purecopy "Context Menu") ignore > + `(menu-item ,(purecopy "Context Menu") ,(make-sparse-keymap) > :filter (lambda (_) (context-menu-map))) > "Menu item that creates the context menu and can be bound to a mouse key.") I confirm that it prevents `where-is-internal` from calling `context-menu-map`, and everything else works fine, but I'm not sure how this change fits into the overall design of the menu bindings. Maybe, `make-sparse-keymap` means that `context-menu-entry` contains an empty menu initially.