]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix menu-bar mouse clicks in "C-h c" and "C-h k" (bug#53322)
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 22 Nov 2021 19:23:26 +0000 (14:23 -0500)
committerEli Zaretskii <eliz@gnu.org>
Thu, 20 Jan 2022 12:17:16 +0000 (14:17 +0200)
* lisp/subr.el (event-start, event-end): Handle '(menu-bar)'
events.
* lisp/net/browse-url.el (browse-url-interactive-arg): Simplify
accordingly.

(cherry picked from commit 9ceb3070e34ad8a54184fd0deda477bf5ff77000)

lisp/net/browse-url.el
lisp/subr.el

index 5f7140fac4f69f17223786b72c9b10939a4f3e92..3aafbea7c375e1fc4d7263901e1b4f8f234a402d 100644 (file)
@@ -730,8 +730,7 @@ position clicked before acting.
 This function returns a list (URL NEW-WINDOW-FLAG)
 for use in `interactive'."
   (let ((event (elt (this-command-keys) 0)))
-    (when (mouse-event-p event)
-      (mouse-set-point event)))
+    (mouse-set-point event))
   (list (read-string prompt (or (and transient-mark-mode mark-active
                                     ;; rfc2396 Appendix E.
                                     (replace-regexp-in-string
index 62839c9b25b4acb3c5e5d3af3c5423f75e91c634..8e5a65efcd2d4ecf08c95b5e867144d84947cb7f 100644 (file)
@@ -1511,22 +1511,22 @@ nil or (STRING . POSITION)'.
 `posn-timestamp': The time the event occurred, in milliseconds.
 
 For more information, see Info node `(elisp)Click Events'."
-  (if (consp event) (nth 1 event)
-    ;; Use `window-point' for the case when the current buffer
-    ;; is temporarily switched to some other buffer (bug#50256)
-    (or (posn-at-point (window-point))
-        (list (selected-window) (window-point) '(0 . 0) 0))))
+  (or (and (consp event) (nth 1 event))
+      ;; Use `window-point' for the case when the current buffer
+      ;; is temporarily switched to some other buffer (bug#50256)
+      (posn-at-point (window-point))
+      (list (selected-window) (window-point) '(0 . 0) 0)))
 
 (defun event-end (event)
   "Return the ending position of EVENT.
 EVENT should be a click, drag, or key press event.
 
 See `event-start' for a description of the value returned."
-  (if (consp event) (nth (if (consp (nth 2 event)) 2 1) event)
-    ;; Use `window-point' for the case when the current buffer
-    ;; is temporarily switched to some other buffer (bug#50256)
-    (or (posn-at-point (window-point))
-        (list (selected-window) (window-point) '(0 . 0) 0))))
+  (or (and (consp event) (nth (if (consp (nth 2 event)) 2 1) event))
+      ;; Use `window-point' for the case when the current buffer
+      ;; is temporarily switched to some other buffer (bug#50256)
+      (posn-at-point (window-point))
+      (list (selected-window) (window-point) '(0 . 0) 0)))
 
 (defsubst event-click-count (event)
   "Return the multi-click count of EVENT, a click or drag event.