From 2d1564103e2024eeb4377b473f28e1523a5206bc Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 28 Sep 2021 22:00:41 +0300 Subject: [PATCH] * lisp/mouse.el (context-menu-map): Fix when menu is a command (bug#50851) * lisp/help.el (help--analyze-key): Get information at the position of mouse click such as 'C-h k' on a context menu item (bug#50067). --- lisp/help.el | 2 +- lisp/mouse.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index 8f771670408..b794751ecab 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -695,7 +695,7 @@ 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" "")) - (defn (key-binding key t))) + (defn (save-excursion (mouse-set-point event) (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)))) diff --git a/lisp/mouse.el b/lisp/mouse.el index d80b241af52..5d4e05fa25e 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -328,7 +328,7 @@ the function `context-menu-filter-function'." ;; Remove duplicate separators (let ((l menu)) - (while l + (while (consp l) (when (and (equal (cdr-safe (car l)) menu-bar-separator) (equal (cdr-safe (cadr l)) menu-bar-separator)) (setcdr l (cddr l))) -- 2.39.5