comparison lisp/mouse.el @ 22845:bd706438b50c

(mouse-delete-window): If the frame has just one window, bury the current buffer instead.
author Richard M. Stallman <rms@gnu.org>
date Wed, 29 Jul 1998 05:41:04 +0000
parents 6655c426d447
children dfb255fb91c8
comparison
equal deleted inserted replaced
22844:1104a715c324 22845:bd706438b50c
121 ;; Give temporary modes such as isearch a chance to turn off. 121 ;; Give temporary modes such as isearch a chance to turn off.
122 (run-hooks 'mouse-leave-buffer-hook)) 122 (run-hooks 'mouse-leave-buffer-hook))
123 123
124 (defun mouse-delete-window (click) 124 (defun mouse-delete-window (click)
125 "Delete the window you click on. 125 "Delete the window you click on.
126 This must be bound to a mouse click." 126 If the frame has just one window, bury the current buffer instead.
127 This command must be bound to a mouse click."
127 (interactive "e") 128 (interactive "e")
128 (mouse-minibuffer-check click) 129 (if (one-window-p t)
129 (delete-window (posn-window (event-start click)))) 130 (bury-buffer)
131 (mouse-minibuffer-check click)
132 (delete-window (posn-window (event-start click)))))
130 133
131 (defun mouse-select-window (click) 134 (defun mouse-select-window (click)
132 "Select the window clicked on; don't move point." 135 "Select the window clicked on; don't move point."
133 (interactive "e") 136 (interactive "e")
134 (mouse-minibuffer-check click) 137 (mouse-minibuffer-check click)