diff options
author | Juri Linkov <juri@linkov.net> | 2021-10-13 22:17:27 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2021-10-13 22:17:27 +0300 |
commit | 9ed53b022db7df2d027a82af6897ea8ac977664b (patch) | |
tree | cbcb68f22b0ddcfe7f43675e5ab57416eb15088c /lisp/help.el | |
parent | efb1cd7fa9f1a71ad3bf34627fe678acfcb48b38 (diff) | |
download | emacs-9ed53b022db7df2d027a82af6897ea8ac977664b.tar.gz emacs-9ed53b022db7df2d027a82af6897ea8ac977664b.tar.bz2 emacs-9ed53b022db7df2d027a82af6897ea8ac977664b.zip |
* lisp/help.el (help--analyze-key): Avoid mouse-set-point for non-mouse events
(bug#51173)
Diffstat (limited to 'lisp/help.el')
-rw-r--r-- | lisp/help.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/help.el b/lisp/help.el index eaca33795ae..7e2e492a368 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -695,11 +695,13 @@ Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)." (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers) (memq 'drag modifiers)) " at that spot" "")) - ;; Use mouse-set-point to handle the case when a menu item + ;; Use `mouse-set-point' to handle the case when a menu item ;; is selected from the context menu that should describe KEY ;; at the position of mouse click that opened the context menu. - ;; When no mouse was involved, it defaults to window-point. - (defn (save-excursion (mouse-set-point event) (key-binding key t)))) + ;; When no mouse was involved, don't use `mouse-set-point'. + (defn (if (consp event) + (save-excursion (mouse-set-point event) (key-binding key t)) + (key-binding key t)))) ;; Handle the case where we faked an entry in "Select and Paste" menu. (when (and (eq defn nil) (stringp (aref key (1- (length key)))) |