Function: window-min-delta

window-min-delta is a byte-compiled function defined in window.el.gz.

Signature

(window-min-delta &optional WINDOW HORIZONTAL IGNORE TRAIL NOUP NODOWN PIXELWISE)

Documentation

Return number of lines by which WINDOW can be shrunk.

WINDOW must be a valid window and defaults to the selected one. Return zero if WINDOW cannot be shrunk.

Optional argument HORIZONTAL non-nil means return number of columns by which WINDOW can be shrunk.

The optional argument IGNORE has the same meaning as for window-resizable. Optional argument TRAIL restricts the windows that can be enlarged. If its value is before, only windows to the left of or above WINDOW can be enlarged. If it is after, only windows to the right of or below WINDOW can be enlarged.

Optional argument NOUP non-nil means don't go up in the window tree, but try to enlarge windows within WINDOW's combination only. Optional argument NODOWN non-nil means don't check whether WINDOW itself (and its child windows) can be shrunk; check only whether at least one other window can be enlarged appropriately.

Optional argument PIXELWISE non-nil means return number of pixels by which WINDOW can be shrunk.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window-min-delta (&optional window horizontal ignore trail noup nodown pixelwise)
  "Return number of lines by which WINDOW can be shrunk.
WINDOW must be a valid window and defaults to the selected one.
Return zero if WINDOW cannot be shrunk.

Optional argument HORIZONTAL non-nil means return number of
columns by which WINDOW can be shrunk.

The optional argument IGNORE has the same meaning as for
`window-resizable'.  Optional argument TRAIL restricts the
windows that can be enlarged.  If its value is `before', only
windows to the left of or above WINDOW can be enlarged.  If it is
`after', only windows to the right of or below WINDOW can be
enlarged.

Optional argument NOUP non-nil means don't go up in the window
tree, but try to enlarge windows within WINDOW's combination
only.  Optional argument NODOWN non-nil means don't check whether
WINDOW itself (and its child windows) can be shrunk; check only
whether at least one other window can be enlarged appropriately.

Optional argument PIXELWISE non-nil means return number of pixels
by which WINDOW can be shrunk."
  (setq window (window-normalize-window window))
  (let ((size (window-size window horizontal pixelwise 'floor))
	(minimum (window-min-size window horizontal ignore pixelwise)))
    (cond
     (nodown
      ;; If NODOWN is t, try to recover the entire size of WINDOW.
      (window--min-delta-1
       window size horizontal ignore trail noup pixelwise))
     ((<= size minimum)
      ;; If NODOWN is nil and WINDOW's size is already at its minimum,
      ;; there's nothing to recover.
      0)
     (t
      ;; Otherwise, try to recover whatever WINDOW is larger than its
      ;; minimum size.
      (window--min-delta-1
       window (- size minimum) horizontal ignore trail noup pixelwise)))))