diff options
| author | Stefan Monnier | 2021-11-22 14:23:26 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2021-11-22 14:23:42 -0500 |
| commit | 9ceb3070e34ad8a54184fd0deda477bf5ff77000 (patch) | |
| tree | c6005d2acc2426bff0bc0d4e2451ec3bad22b388 | |
| parent | 44923722f42c2974c140e385c4c765f60944efe7 (diff) | |
| download | emacs-9ceb3070e34ad8a54184fd0deda477bf5ff77000.tar.gz emacs-9ceb3070e34ad8a54184fd0deda477bf5ff77000.zip | |
* lisp/subr.el (event-start, event-end): Handle `(menu-bar)` events
* lisp/net/browse-url.el (browse-url-interactive-arg): Simplify accordingly
| -rw-r--r-- | lisp/net/browse-url.el | 3 | ||||
| -rw-r--r-- | lisp/subr.el | 20 |
2 files changed, 11 insertions, 12 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 19afb813317..011e43c447b 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -737,8 +737,7 @@ position clicked before acting. | |||
| 737 | This function returns a list (URL NEW-WINDOW-FLAG) | 737 | This function returns a list (URL NEW-WINDOW-FLAG) |
| 738 | for use in `interactive'." | 738 | for use in `interactive'." |
| 739 | (let ((event (elt (this-command-keys) 0))) | 739 | (let ((event (elt (this-command-keys) 0))) |
| 740 | (when (mouse-event-p event) | 740 | (mouse-set-point event)) |
| 741 | (mouse-set-point event))) | ||
| 742 | (list (read-string prompt (or (and transient-mark-mode mark-active | 741 | (list (read-string prompt (or (and transient-mark-mode mark-active |
| 743 | ;; rfc2396 Appendix E. | 742 | ;; rfc2396 Appendix E. |
| 744 | (replace-regexp-in-string | 743 | (replace-regexp-in-string |
diff --git a/lisp/subr.el b/lisp/subr.el index 867db47a47e..06ea503da6a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1553,22 +1553,22 @@ nil or (STRING . POSITION)'. | |||
| 1553 | `posn-timestamp': The time the event occurred, in milliseconds. | 1553 | `posn-timestamp': The time the event occurred, in milliseconds. |
| 1554 | 1554 | ||
| 1555 | For more information, see Info node `(elisp)Click Events'." | 1555 | For more information, see Info node `(elisp)Click Events'." |
| 1556 | (if (consp event) (nth 1 event) | 1556 | (or (and (consp event) (nth 1 event)) |
| 1557 | ;; Use `window-point' for the case when the current buffer | 1557 | ;; Use `window-point' for the case when the current buffer |
| 1558 | ;; is temporarily switched to some other buffer (bug#50256) | 1558 | ;; is temporarily switched to some other buffer (bug#50256) |
| 1559 | (or (posn-at-point (window-point)) | 1559 | (posn-at-point (window-point)) |
| 1560 | (list (selected-window) (window-point) '(0 . 0) 0)))) | 1560 | (list (selected-window) (window-point) '(0 . 0) 0))) |
| 1561 | 1561 | ||
| 1562 | (defun event-end (event) | 1562 | (defun event-end (event) |
| 1563 | "Return the ending position of EVENT. | 1563 | "Return the ending position of EVENT. |
| 1564 | EVENT should be a click, drag, or key press event. | 1564 | EVENT should be a click, drag, or key press event. |
| 1565 | 1565 | ||
| 1566 | See `event-start' for a description of the value returned." | 1566 | See `event-start' for a description of the value returned." |
| 1567 | (if (consp event) (nth (if (consp (nth 2 event)) 2 1) event) | 1567 | (or (and (consp event) (nth (if (consp (nth 2 event)) 2 1) event)) |
| 1568 | ;; Use `window-point' for the case when the current buffer | 1568 | ;; Use `window-point' for the case when the current buffer |
| 1569 | ;; is temporarily switched to some other buffer (bug#50256) | 1569 | ;; is temporarily switched to some other buffer (bug#50256) |
| 1570 | (or (posn-at-point (window-point)) | 1570 | (posn-at-point (window-point)) |
| 1571 | (list (selected-window) (window-point) '(0 . 0) 0)))) | 1571 | (list (selected-window) (window-point) '(0 . 0) 0))) |
| 1572 | 1572 | ||
| 1573 | (defsubst event-click-count (event) | 1573 | (defsubst event-click-count (event) |
| 1574 | "Return the multi-click count of EVENT, a click or drag event. | 1574 | "Return the multi-click count of EVENT, a click or drag event. |