summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
diff options
context:
space:
mode:
authorVisuwesh <visuweshm@gmail.com>2022-06-26 17:45:45 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-06-26 17:45:45 +0200
commit9e08c04798e994abc929f52e15b9ecb7e0ad53be (patch)
tree039ecb87c77d50523e41d1cce33ec05fee30c89a /lisp/mouse.el
parentcd6ce7e546e6d2ed1918a1d20341c1e4c9050a9a (diff)
downloademacs-9e08c04798e994abc929f52e15b9ecb7e0ad53be.tar.gz
Make <mouse-2> in mode line more careful as well
* lisp/mouse.el (mouse-delete-other-windows): Only delete other windows if the user didn't move the cursor off the mode-line (bug#56198).
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r--lisp/mouse.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 3b33ba817b2..98e49c3598f 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -687,10 +687,13 @@ This command must be bound to a mouse click."
(switch-to-buffer buf)
(delete-window window)))
-(defun mouse-delete-other-windows ()
+(defun mouse-delete-other-windows (click)
"Delete all windows except the one you click on."
- (interactive "@")
- (delete-other-windows))
+ (interactive "e")
+ (when (and (eq (posn-area (event-end click)) 'mode-line)
+ (eq (posn-window (event-start click))
+ (posn-window (event-end click))))
+ (delete-other-windows (posn-window (event-start click)))))
(defun mouse-split-window-vertically (click)
"Select Emacs window mouse is on, then split it vertically in half.