emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 9e08c04798: Make <mouse-2> in mode line more careful as well


From: Lars Ingebrigtsen
Subject: master 9e08c04798: Make <mouse-2> in mode line more careful as well
Date: Sun, 26 Jun 2022 11:48:33 -0400 (EDT)

branch: master
commit 9e08c04798e994abc929f52e15b9ecb7e0ad53be
Author: Visuwesh <visuweshm@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/mouse.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 3b33ba817b..98e49c3598 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]