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, 30 Aug 2021 10:33:47 +0300 Organization: LINKOV.NET Message-ID: <87r1ebz98c.fsf@mail.linkov.net> References: <76FA3F83D086455EAA01FF0FB000FCDB@us.oracle.com> <871r6hk99k.fsf@gnus.org> <87bl5k2ug1.fsf@gnus.org> <87czpwb4gw.fsf@mail.linkov.net> <87y28kf5sn.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31601"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 9923@debbugs.gnu.org, Stefan Monnier To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 30 09:42:20 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 1mKbvv-00085Y-Hg for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Aug 2021 09:42:19 +0200 Original-Received: from localhost ([::1]:39916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKbvu-0007Iu-Fo for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Aug 2021 03:42:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKbve-0007GL-Rc for bug-gnu-emacs@gnu.org; Mon, 30 Aug 2021 03:42:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKbve-0003Mv-Jx for bug-gnu-emacs@gnu.org; Mon, 30 Aug 2021 03:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mKbve-0000T5-Hi for bug-gnu-emacs@gnu.org; Mon, 30 Aug 2021 03:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Aug 2021 07:42: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.16303092861728 (code B ref 9923); Mon, 30 Aug 2021 07:42:02 +0000 Original-Received: (at 9923) by debbugs.gnu.org; 30 Aug 2021 07:41:26 +0000 Original-Received: from localhost ([127.0.0.1]:58018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKbv3-0000Ro-PV for submit@debbugs.gnu.org; Mon, 30 Aug 2021 03:41:25 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:49447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKbv2-0000RM-Hv for 9923@debbugs.gnu.org; Mon, 30 Aug 2021 03:41:25 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 5F05320016; Mon, 30 Aug 2021 07:41:15 +0000 (UTC) In-Reply-To: <87y28kf5sn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 29 Aug 2021 20:46:00 +0200") 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:213005 Archived-At: >> Another question: is it possible not to evaluate :filter in where-is as all? > > Then it'd find even less commands, I think? I thought that maybe it's possible somehow to avoid :filter evaluation for menus. >> Yesterday I added to context-menu-map such lines: >> >> (let ((fun (mouse-posn-property (event-start last-input-event) >> 'context-menu-function))) >> >> but now noticed that after typing 'C-h m' it fails with: >> >> Debugger entered--Lisp error: (args-out-of-range 1786) >> mouse-posn-property((# 1786 (0 . 0) 0) context-menu-function) >> context-menu-map() > > Well, you could just check that last-input-event is a mouse event before > calling that function? This patch fixes the error, but still e.g. in Info buffer typing 'C-h m q' moves point in the Info buffer to some fixed position (maybe related to a position in *Help* buffer), i.e. still something is wrong. diff --git a/lisp/mouse.el b/lisp/mouse.el index 7d3ed9a0e4..f4d7d86c28 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -307,15 +307,19 @@ context-menu-filter-function (defun context-menu-map () "Return composite menu map." (let ((menu (make-sparse-keymap (propertize "Context Menu" 'hide t)))) - (let ((fun (mouse-posn-property (event-start last-input-event) - 'context-menu-function))) + (let ((fun + ;; Check if `where-is-internal' calls this in wrong buffer. + (when (eq (window-buffer (posn-window (event-start last-input-event))) + (current-buffer)) + (mouse-posn-property (event-start last-input-event) + 'context-menu-function)))) (if (functionp fun) (setq menu (funcall fun menu)) (run-hook-wrapped 'context-menu-functions