aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2025-07-09 09:46:46 +0300
committerJuri Linkov2025-07-09 09:48:17 +0300
commit280d6f70a356dc24a7026c00cbcbd116c2f7c7ed (patch)
treee838e58b05e550d6c67c923e20a8a7049fb2ca77
parent159ddd27ee6b6c8cd261c6ff495e66ddb6166685 (diff)
downloademacs-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.el3
-rw-r--r--lisp/tab-bar.el3
-rw-r--r--lisp/windmove.el3
-rw-r--r--lisp/window.el12
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.
1263The next buffer is the buffer displayed by the next command invoked 1263The next buffer is the buffer displayed by the next command invoked
1264immediately after this command (ignoring reading from the minibuffer). 1264immediately after this command (ignoring reading from the minibuffer).
1265In case of multiple consecutive mouse events such as <down-mouse-1>,
1266a mouse release event <mouse-1>, <double-mouse-1>, <triple-mouse-1>
1267all bound commands are handled until one of them displays a buffer.
1265Creates a new frame before displaying the buffer. 1268Creates a new frame before displaying the buffer.
1266When `switch-to-buffer-obey-display-actions' is non-nil, 1269When `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.
3044The next buffer is the buffer displayed by the next command invoked 3044The next buffer is the buffer displayed by the next command invoked
3045immediately after this command (ignoring reading from the minibuffer). 3045immediately after this command (ignoring reading from the minibuffer).
3046In case of multiple consecutive mouse events such as <down-mouse-1>,
3047a mouse release event <mouse-1>, <double-mouse-1>, <triple-mouse-1>
3048all bound commands are handled until one of them displays a buffer.
3046Creates a new tab before displaying the buffer, or switches to the tab 3049Creates a new tab before displaying the buffer, or switches to the tab
3047that already contains that buffer. 3050that already contains that buffer.
3048When `switch-to-buffer-obey-display-actions' is non-nil, 3051When `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.
587The next buffer is the buffer displayed by the next command invoked 587The next buffer is the buffer displayed by the next command invoked
588immediately after this command (ignoring reading from the minibuffer). 588immediately after this command (ignoring reading from the minibuffer).
589In case of multiple consecutive mouse events such as <down-mouse-1>,
590a mouse release event <mouse-1>, <double-mouse-1>, <triple-mouse-1>
591all bound commands are handled until one of them displays a buffer.
589Create a new window if there is no window in that direction. 592Create a new window if there is no window in that direction.
590 593
591By default, select the new window with a displayed buffer. 594By 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.
4077The next buffer is the buffer displayed by the next command invoked 4077The next buffer is the buffer displayed by the next command invoked
4078immediately after this command (ignoring reading from the minibuffer). 4078immediately after this command (ignoring reading from the minibuffer).
4079In case of multiple consecutive mouse events such as <down-mouse-1>,
4080a mouse release event <mouse-1>, <double-mouse-1>, <triple-mouse-1>
4081all bound commands are handled until one of them displays a buffer.
4079Creates a new window before displaying the buffer. 4082Creates a new window before displaying the buffer.
4080When `switch-to-buffer-obey-display-actions' is non-nil, 4083When `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.
4097The next buffer is the buffer displayed by the next command invoked 4100The next buffer is the buffer displayed by the next command invoked
4098immediately after this command (ignoring reading from the minibuffer). 4101immediately after this command (ignoring reading from the minibuffer).
4102In case of multiple consecutive mouse events such as <down-mouse-1>,
4103a mouse release event <mouse-1>, <double-mouse-1>, <triple-mouse-1>
4104all bound commands are handled until one of them displays a buffer.
4099Even when the default rule should display the buffer in a new window, 4105Even when the default rule should display the buffer in a new window,
4100force its display in the already selected window. 4106force its display in the already selected window.
4101When `switch-to-buffer-obey-display-actions' is non-nil, 4107When `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)