diff options
| author | Juri Linkov | 2025-07-09 09:46:46 +0300 |
|---|---|---|
| committer | Juri Linkov | 2025-07-09 09:48:17 +0300 |
| commit | 280d6f70a356dc24a7026c00cbcbd116c2f7c7ed (patch) | |
| tree | e838e58b05e550d6c67c923e20a8a7049fb2ca77 | |
| parent | 159ddd27ee6b6c8cd261c6ff495e66ddb6166685 (diff) | |
| download | emacs-280d6f70a356dc24a7026c00cbcbd116c2f7c7ed.tar.gz emacs-280d6f70a356dc24a7026c00cbcbd116c2f7c7ed.zip | |
Handle multiple mouse events in display-buffer-override-next-command
* lisp/window.el (display-buffer-override-next-command):
Use 'mouse-event-p' to wait for more following mouse events.
* lisp/frame.el (other-frame-prefix):
* lisp/tab-bar.el (other-tab-prefix):
* lisp/windmove.el (windmove-display-in-direction):
* lisp/window.el (other-window-prefix, same-window-prefix):
Update the docstring to explain the behavior in regard
to multiple consecutive mouse events (bug#78945).
| -rw-r--r-- | lisp/frame.el | 3 | ||||
| -rw-r--r-- | lisp/tab-bar.el | 3 | ||||
| -rw-r--r-- | lisp/windmove.el | 3 | ||||
| -rw-r--r-- | lisp/window.el | 12 |
4 files changed, 18 insertions, 3 deletions
diff --git a/lisp/frame.el b/lisp/frame.el index 81af9e963fe..f07a59c78d2 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -1262,6 +1262,9 @@ that variable should be nil." | |||
| 1262 | "Display the buffer of the next command in a new frame. | 1262 | "Display the buffer of the next command in a new frame. |
| 1263 | The next buffer is the buffer displayed by the next command invoked | 1263 | The next buffer is the buffer displayed by the next command invoked |
| 1264 | immediately after this command (ignoring reading from the minibuffer). | 1264 | immediately after this command (ignoring reading from the minibuffer). |
| 1265 | In case of multiple consecutive mouse events such as <down-mouse-1>, | ||
| 1266 | a mouse release event <mouse-1>, <double-mouse-1>, <triple-mouse-1> | ||
| 1267 | all bound commands are handled until one of them displays a buffer. | ||
| 1265 | Creates a new frame before displaying the buffer. | 1268 | Creates a new frame before displaying the buffer. |
| 1266 | When `switch-to-buffer-obey-display-actions' is non-nil, | 1269 | When `switch-to-buffer-obey-display-actions' is non-nil, |
| 1267 | `switch-to-buffer' commands are also supported." | 1270 | `switch-to-buffer' commands are also supported." |
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 6a86962476e..53da087384d 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el | |||
| @@ -3043,6 +3043,9 @@ files will be visited." | |||
| 3043 | "Display the buffer of the next command in a new tab. | 3043 | "Display the buffer of the next command in a new tab. |
| 3044 | The next buffer is the buffer displayed by the next command invoked | 3044 | The next buffer is the buffer displayed by the next command invoked |
| 3045 | immediately after this command (ignoring reading from the minibuffer). | 3045 | immediately after this command (ignoring reading from the minibuffer). |
| 3046 | In case of multiple consecutive mouse events such as <down-mouse-1>, | ||
| 3047 | a mouse release event <mouse-1>, <double-mouse-1>, <triple-mouse-1> | ||
| 3048 | all bound commands are handled until one of them displays a buffer. | ||
| 3046 | Creates a new tab before displaying the buffer, or switches to the tab | 3049 | Creates a new tab before displaying the buffer, or switches to the tab |
| 3047 | that already contains that buffer. | 3050 | that already contains that buffer. |
| 3048 | When `switch-to-buffer-obey-display-actions' is non-nil, | 3051 | When `switch-to-buffer-obey-display-actions' is non-nil, |
diff --git a/lisp/windmove.el b/lisp/windmove.el index 4d122c08158..d69a09f3d1e 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el | |||
| @@ -586,6 +586,9 @@ When `switch-to-buffer-obey-display-actions' is non-nil, | |||
| 586 | "Display the next buffer in the window at direction DIR. | 586 | "Display the next buffer in the window at direction DIR. |
| 587 | The next buffer is the buffer displayed by the next command invoked | 587 | The next buffer is the buffer displayed by the next command invoked |
| 588 | immediately after this command (ignoring reading from the minibuffer). | 588 | immediately after this command (ignoring reading from the minibuffer). |
| 589 | In case of multiple consecutive mouse events such as <down-mouse-1>, | ||
| 590 | a mouse release event <mouse-1>, <double-mouse-1>, <triple-mouse-1> | ||
| 591 | all bound commands are handled until one of them displays a buffer. | ||
| 589 | Create a new window if there is no window in that direction. | 592 | Create a new window if there is no window in that direction. |
| 590 | 593 | ||
| 591 | By default, select the new window with a displayed buffer. | 594 | By default, select the new window with a displayed buffer. |
diff --git a/lisp/window.el b/lisp/window.el index 27f26224a2a..e229562163b 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -4076,6 +4076,9 @@ always effectively nil." | |||
| 4076 | "Display the buffer of the next command in a new window. | 4076 | "Display the buffer of the next command in a new window. |
| 4077 | The next buffer is the buffer displayed by the next command invoked | 4077 | The next buffer is the buffer displayed by the next command invoked |
| 4078 | immediately after this command (ignoring reading from the minibuffer). | 4078 | immediately after this command (ignoring reading from the minibuffer). |
| 4079 | In case of multiple consecutive mouse events such as <down-mouse-1>, | ||
| 4080 | a mouse release event <mouse-1>, <double-mouse-1>, <triple-mouse-1> | ||
| 4081 | all bound commands are handled until one of them displays a buffer. | ||
| 4079 | Creates a new window before displaying the buffer. | 4082 | Creates a new window before displaying the buffer. |
| 4080 | When `switch-to-buffer-obey-display-actions' is non-nil, | 4083 | When `switch-to-buffer-obey-display-actions' is non-nil, |
| 4081 | `switch-to-buffer' commands are also supported." | 4084 | `switch-to-buffer' commands are also supported." |
| @@ -4096,6 +4099,9 @@ When `switch-to-buffer-obey-display-actions' is non-nil, | |||
| 4096 | "Display the buffer of the next command in the same window. | 4099 | "Display the buffer of the next command in the same window. |
| 4097 | The next buffer is the buffer displayed by the next command invoked | 4100 | The next buffer is the buffer displayed by the next command invoked |
| 4098 | immediately after this command (ignoring reading from the minibuffer). | 4101 | immediately after this command (ignoring reading from the minibuffer). |
| 4102 | In case of multiple consecutive mouse events such as <down-mouse-1>, | ||
| 4103 | a mouse release event <mouse-1>, <double-mouse-1>, <triple-mouse-1> | ||
| 4104 | all bound commands are handled until one of them displays a buffer. | ||
| 4099 | Even when the default rule should display the buffer in a new window, | 4105 | Even when the default rule should display the buffer in a new window, |
| 4100 | force its display in the already selected window. | 4106 | force its display in the already selected window. |
| 4101 | When `switch-to-buffer-obey-display-actions' is non-nil, | 4107 | When `switch-to-buffer-obey-display-actions' is non-nil, |
| @@ -9673,9 +9679,9 @@ to deactivate this overriding action." | |||
| 9673 | ;; But don't remove immediately after | 9679 | ;; But don't remove immediately after |
| 9674 | ;; adding the hook by the same command below. | 9680 | ;; adding the hook by the same command below. |
| 9675 | (eq this-command command) | 9681 | (eq this-command command) |
| 9676 | ;; Don't exit on mouse down event | 9682 | ;; Don't exit on mouse events in anticipation |
| 9677 | ;; in anticipation of mouse release event. | 9683 | ;; of more related events like double click. |
| 9678 | (memq 'down (event-modifiers last-input-event))) | 9684 | (mouse-event-p last-input-event)) |
| 9679 | (funcall exitfun)))) | 9685 | (funcall exitfun)))) |
| 9680 | ;; Call post-function after the next command finishes (bug#49057). | 9686 | ;; Call post-function after the next command finishes (bug#49057). |
| 9681 | (add-hook 'post-command-hook postfun) | 9687 | (add-hook 'post-command-hook postfun) |