GNU bug report logs - #9923
24.0.91; `where-is' does not find recentf menu items (cmds, not files)

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Mon, 31 Oct 2011 20:30:02 UTC

Severity: minor

Tags: confirmed

Found in versions 24.0.91, 25.2

Full log


Message #36 received at 9923 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 9923 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: 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
>> 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((#<window 178 on *scratch*> 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




This bug report was last modified 91 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.