Function: window--sides-verticalize-frame

window--sides-verticalize-frame is a byte-compiled function defined in window.el.gz.

Signature

(window--sides-verticalize-frame &optional FRAME)

Documentation

Maybe change side windows layout on specified FRAME.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window--sides-verticalize-frame (&optional frame)
  "Maybe change side windows layout on specified FRAME."
  (setq frame (window-normalize-frame frame))
  (let ((window--sides-inhibit-check t)
        (root (frame-root-window frame))
	(main (window-main-window frame)))
    (when (and (not (eq main root))
	       (not (eq (window-parent main) root))
	       (window-combined-p main window-sides-vertical))
      (let* ((window--sides-inhibit-check t)
	     (ignore-window-parameters t)
	     (first (window-child root))
	     (first-state
	      (and first (window-parameter first 'window-side)
		   (window-state-get first)))
	     (last (window-last-child root))
	     (last-state
	      (and last (window-parameter last 'window-side)
		   (window-state-get last)))
	     (dummy (get-buffer-create " *dummy*"))
	     major)
	(unwind-protect
	    (progn
	      (when first-state (delete-window first))
	      (when last-state (delete-window last))
	      (when first-state
		(setq major (window--make-major-side-window
			     dummy (if window-sides-vertical 'top 'left) 0))
		(window-state-put first-state major t))
	      (when last-state
		(setq major (window--make-major-side-window
			     dummy (if window-sides-vertical 'bottom 'right) 0))
		(window-state-put last-state major t)))
	  (kill-buffer " *dummy*"))))))