Function: delete-other-windows-vertically

delete-other-windows-vertically is an interactive and byte-compiled function defined in window.el.gz.

Signature

(delete-other-windows-vertically &optional WINDOW)

Documentation

Delete the windows in the same column with WINDOW, but not WINDOW itself.

This may be a useful alternative binding for C-x 1 (delete-other-windows)
 if you often split windows horizontally.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(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))
                   (= (nth 2 e) (nth 2 edges)))
          (push w delenda))))
    (mapc 'delete-window delenda)))