]> git.eshelyaron.com Git - emacs.git/commitdiff
(mouse-delete-window): If the frame has just one window,
authorRichard M. Stallman <rms@gnu.org>
Wed, 29 Jul 1998 05:41:04 +0000 (05:41 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 29 Jul 1998 05:41:04 +0000 (05:41 +0000)
bury the current buffer instead.

lisp/mouse.el

index 5d55b3dfd0e9abbb1680184588c2c835b90b239d..1902db0a32d433d0b2c14da990777487456e4d84 100644 (file)
 
 (defun mouse-delete-window (click)
   "Delete the window you click on.
-This must be bound to a mouse click."
+If the frame has just one window, bury the current buffer instead.
+This command must be bound to a mouse click."
   (interactive "e")
-  (mouse-minibuffer-check click)
-  (delete-window (posn-window (event-start click))))
+  (if (one-window-p t)
+      (bury-buffer)
+    (mouse-minibuffer-check click)
+    (delete-window (posn-window (event-start click)))))
 
 (defun mouse-select-window (click)
   "Select the window clicked on; don't move point."