Function: window--sanitize-window-sizes

window--sanitize-window-sizes is a byte-compiled function defined in window.el.gz.

Signature

(window--sanitize-window-sizes HORIZONTAL)

Documentation

Assert that all windows on selected frame are large enough.

If necessary and possible, make sure that every window on frame FRAME has its minimum height. Optional argument HORIZONTAL non-nil means to make sure that every window on frame FRAME has its minimum width. The minimum height/width of a window is the respective value returned by window-min-size for that window.

Return t if all windows were resized appropriately. Return nil if at least one window could not be resized as requested, which may happen when the FRAME is not large enough to accommodate it.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window--sanitize-window-sizes (horizontal)
  "Assert that all windows on selected frame are large enough.
If necessary and possible, make sure that every window on frame
FRAME has its minimum height.  Optional argument HORIZONTAL
non-nil means to make sure that every window on frame FRAME has
its minimum width.  The minimum height/width of a window is the
respective value returned by `window-min-size' for that window.

Return t if all windows were resized appropriately.  Return nil
if at least one window could not be resized as requested, which
may happen when the FRAME is not large enough to accommodate it."
  (let ((value t))
    (walk-window-tree
     (lambda (window)
       (let  ((delta (- (window-min-size window horizontal nil t)
			(window-size window horizontal t))))
	 (when (> delta 0)
	   (if (window-resizable-p window delta horizontal nil t)
	       (window-resize window delta horizontal nil t)
	     (setq value nil)))))
     nil nil 'nomini)
    value))