aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/window.el15
2 files changed, 19 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index be022bee3cf..415981c8e13 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12008-05-05 Sam Steingold <sds@gnu.org>
2
3 * window.el (delete-other-windows-vertically): New function.
4
12008-05-05 Stefan Monnier <monnier@iro.umontreal.ca> 52008-05-05 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * dired.el (dired-read-dir-and-switches): 7 * dired.el (dired-read-dir-and-switches):
diff --git a/lisp/window.el b/lisp/window.el
index eab0f2b27fc..056ce84085a 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1095,6 +1095,21 @@ active. This function is run by `mouse-autoselect-window-timer'."
1095 (run-hooks 'mouse-leave-buffer-hook)) 1095 (run-hooks 'mouse-leave-buffer-hook))
1096 (select-window window)))) 1096 (select-window window))))
1097 1097
1098(defun delete-other-windows-vertically (&optional window)
1099 "Delete the windows in the same column with WINDOW, but not WINDOW itself.
1100This may be a useful alternative binding for \\[delete-other-windows]
1101 if you often split windows horizontally."
1102 (interactive)
1103 (let* ((window (or window (selected-window)))
1104 (edges (window-edges window))
1105 (w window) delenda)
1106 (while (not (eq (setq w (next-window w 1)) window))
1107 (let ((e (window-edges w)))
1108 (when (and (= (car e) (car edges))
1109 (= (caddr e) (caddr edges)))
1110 (push w delenda))))
1111 (mapc 'delete-window delenda)))
1112
1098(define-key ctl-x-map "2" 'split-window-vertically) 1113(define-key ctl-x-map "2" 'split-window-vertically)
1099(define-key ctl-x-map "3" 'split-window-horizontally) 1114(define-key ctl-x-map "3" 'split-window-horizontally)
1100(define-key ctl-x-map "}" 'enlarge-window-horizontally) 1115(define-key ctl-x-map "}" 'enlarge-window-horizontally)