emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/window.el,v


From: Sam Steingold
Subject: [Emacs-diffs] Changes to emacs/lisp/window.el,v
Date: Mon, 05 May 2008 20:12:26 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Sam Steingold <sds>     08/05/05 20:12:25

Index: window.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/window.el,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -b -r1.132 -r1.133
--- window.el   29 Mar 2008 23:03:18 -0000      1.132
+++ window.el   5 May 2008 20:12:24 -0000       1.133
@@ -1095,6 +1095,21 @@
        (run-hooks 'mouse-leave-buffer-hook))
       (select-window window))))
 
+(defun delete-other-windows-vertically (&optional window)
+  "Delete the windows in the same column with WINDOW, but not WINDOW itself.
+This may be a useful alternative binding for \\[delete-other-windows]
+ if you often split windows horizontally."
+  (interactive)
+  (let* ((window (or window (selected-window)))
+         (edges (window-edges window))
+         (w window) delenda)
+    (while (not (eq (setq w (next-window w 1)) window))
+      (let ((e (window-edges w)))
+        (when (and (= (car e) (car edges))
+                   (= (caddr e) (caddr edges)))
+          (push w delenda))))
+    (mapc 'delete-window delenda)))
+
 (define-key ctl-x-map "2" 'split-window-vertically)
 (define-key ctl-x-map "3" 'split-window-horizontally)
 (define-key ctl-x-map "}" 'enlarge-window-horizontally)




reply via email to

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