summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-11-22 14:23:26 -0500
committerEli Zaretskii <eliz@gnu.org>2022-01-20 14:17:16 +0200
commitf08dfa9b532648457590262c1afa9729e87c6bb1 (patch)
treebea0c3989baf6168c0c928f630404a7b92dc9cf6
parent11ea45c9e47d13e13e3e539551e2df300f995c11 (diff)
downloademacs-f08dfa9b532648457590262c1afa9729e87c6bb1.tar.gz
Fix menu-bar mouse clicks in "C-h c" and "C-h k" (bug#53322)
* 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)
-rw-r--r--lisp/net/browse-url.el3
-rw-r--r--lisp/subr.el20
2 files changed, 11 insertions, 12 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 5f7140fac4f..3aafbea7c37 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -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
diff --git a/lisp/subr.el b/lisp/subr.el
index 62839c9b25b..8e5a65efcd2 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -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.