Function: window-sizable

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

Signature

(window-sizable WINDOW DELTA &optional HORIZONTAL IGNORE PIXELWISE)

Documentation

Return DELTA if DELTA lines can be added to WINDOW.

WINDOW must be a valid window and defaults to the selected one. Optional argument HORIZONTAL non-nil means return DELTA if DELTA columns can be added to WINDOW. A return value of zero means that no lines (or columns) can be added to WINDOW.

This function looks only at WINDOW and, recursively, its child windows. The function window-resizable looks at other windows as well.

DELTA positive means WINDOW shall be enlarged by DELTA lines or columns. If WINDOW cannot be enlarged by DELTA lines or columns return the maximum value in the range 0..DELTA by which WINDOW can be enlarged.

DELTA negative means WINDOW shall be shrunk by -DELTA lines or columns. If WINDOW cannot be shrunk by -DELTA lines or columns, return the minimum value in the range DELTA..0 by which WINDOW can be shrunk.

The optional argument IGNORE has the same meaning as for window-resizable. Optional argument PIXELWISE non-nil means interpret DELTA as pixels.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window-sizable (window delta &optional horizontal ignore pixelwise)
  "Return DELTA if DELTA lines can be added to WINDOW.
WINDOW must be a valid window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return DELTA if DELTA
columns can be added to WINDOW.  A return value of zero means
that no lines (or columns) can be added to WINDOW.

This function looks only at WINDOW and, recursively, its child
windows.  The function `window-resizable' looks at other windows
as well.

DELTA positive means WINDOW shall be enlarged by DELTA lines or
columns.  If WINDOW cannot be enlarged by DELTA lines or columns
return the maximum value in the range 0..DELTA by which WINDOW
can be enlarged.

DELTA negative means WINDOW shall be shrunk by -DELTA lines or
columns.  If WINDOW cannot be shrunk by -DELTA lines or columns,
return the minimum value in the range DELTA..0 by which WINDOW
can be shrunk.

The optional argument IGNORE has the same meaning as for
`window-resizable'.  Optional argument PIXELWISE non-nil means
interpret DELTA as pixels."
  (setq window (window-normalize-window window))
  (cond
   ((< delta 0)
    (let ((min-size (window-min-size window horizontal ignore pixelwise))
          (size (window-size window horizontal pixelwise)))
      (if (<= size min-size)
          0
        (max (- min-size size) delta))))
   ((> delta 0)
    (if (window-size-fixed-p window horizontal ignore)
	0
      delta))
   (t 0)))