Juri Linkov writes: >> the below patch adds the commands occur-word-at-mouse and >> occur-symbol-at-mouse, and a function for context-menu-mode to occur >> words or symbols where the context menu was invoked. >> >> Would there be any interest in adding such a functionality? > > Thanks. There is a new function 'thing-at-mouse' with a new arg 'click' > added today that you can use instead of 'thing-at-point'. > You can see an example in lisp/net/dictionary.el. I see, but I wonder why dictionary.el directly manipulates context-menu-functions with add-hook. >> diff --git a/lisp/mouse.el b/lisp/mouse.el >> index 7d3ed9a0e4..3590e27e3e 100644 >> --- a/lisp/mouse.el >> +++ b/lisp/mouse.el >>[...] >> +(defun context-menu-occur (menu) > > The default set of context menus in mouse.el contains only menus > created from the existing non-context menus. All new context menus > should be added to their respective packages. So please move > context-menu-occur to replace.el. > > Another example prog-context-menu in lisp/progmodes/prog-mode.el also > demonstrates how context menus should belong to the package where they > are used. And prog-context-menu is similar to context-menu-occur, > so it should have the name prefix of the package: occur-context-menu. Ok, no problem. This should do it: