diff options
| author | Sam Steingold | 2008-05-05 20:12:24 +0000 |
|---|---|---|
| committer | Sam Steingold | 2008-05-05 20:12:24 +0000 |
| commit | 4ecc0b678728d3affd3f376dfefa19e2e70c30c4 (patch) | |
| tree | 9ea01bd84304ad2e6a092b1279001e25d7aba1d6 | |
| parent | d0c66c5b2abdbaad24fa694f477a98a57f06e32a (diff) | |
| download | emacs-4ecc0b678728d3affd3f376dfefa19e2e70c30c4.tar.gz emacs-4ecc0b678728d3affd3f376dfefa19e2e70c30c4.zip | |
(delete-other-windows-vertically): New function.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/window.el | 15 |
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 @@ | |||
| 1 | 2008-05-05 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * window.el (delete-other-windows-vertically): New function. | ||
| 4 | |||
| 1 | 2008-05-05 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2008-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. | ||
| 1100 | This 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) |