]> git.eshelyaron.com Git - emacs.git/commitdiff
lisp/net/browse-url.el (browse-url-interactive-arg): Fix bug#78026
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 10 May 2025 16:05:17 +0000 (12:05 -0400)
committerEshel Yaron <me@eshelyaron.com>
Mon, 12 May 2025 19:54:41 +0000 (21:54 +0200)
Don't burp when run from a timer where (this-command-keys) will
usually return an empty vector.

(cherry picked from commit 66990628b8f91554e05aa2bee9a657149ac0037c)

lisp/net/browse-url.el

index 02d25b0ade47f470ceee70cc94458741eefc8dbf..21fad0dd50c30b3e61a7763695422285b683dc28 100644 (file)
@@ -712,8 +712,7 @@ This function returns a list (URL NEW-WINDOW-FLAG) for use in
 `interactive'.  NEW-WINDOW-FLAG is the prefix arg; if
 `browse-url-new-window-flag' is non-nil, invert the prefix arg
 instead."
-  (let ((event (elt (this-command-keys) 0)))
-    (mouse-set-point event))
+  (mouse-set-point last-nonmenu-event)
   (list (read-string prompt (or (and transient-mark-mode mark-active
                                     ;; rfc2396 Appendix E.
                                     (replace-regexp-in-string