Function: window--resize-this-window

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

Signature

(window--resize-this-window WINDOW DELTA &optional HORIZONTAL IGNORE ADD TRAIL EDGE CHAR-SIZE)

Documentation

Resize WINDOW vertically by DELTA pixels.

Optional argument HORIZONTAL non-nil means resize WINDOW horizontally by DELTA pixels.

The optional argument IGNORE has the same meaning as for window-resizable. Optional argument ADD non-nil means add DELTA to the new total size of WINDOW.

Optional arguments TRAIL and EDGE, when non-nil, refine the set of windows that shall be resized. If TRAIL equals before, resize only windows on the left or above EDGE. If TRAIL equals after, resize only windows on the right or below EDGE. Also, preferably only resize windows adjacent to EDGE.

If the optional argument CHAR-SIZE is a positive integer, it specifies the number of pixels by which windows are incrementally resized. If CHAR-SIZE is nil, this means to use the value of frame-char-height or frame-char-width of WINDOW's frame.

This function recursively resizes WINDOW's child windows to fit the new size. Make sure that WINDOW is window--resizable before calling this function. Note that this function does not resize siblings of WINDOW or WINDOW's parent window. You have to eventually call window-resize-apply in order to make resizing actually take effect.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window--resize-this-window (window delta &optional horizontal ignore add trail edge char-size)
  "Resize WINDOW vertically by DELTA pixels.
Optional argument HORIZONTAL non-nil means resize WINDOW
horizontally by DELTA pixels.

The optional argument IGNORE has the same meaning as for
`window-resizable'.  Optional argument ADD non-nil means add
DELTA to the new total size of WINDOW.

Optional arguments TRAIL and EDGE, when non-nil, refine the set
of windows that shall be resized.  If TRAIL equals `before',
resize only windows on the left or above EDGE.  If TRAIL equals
`after', resize only windows on the right or below EDGE.  Also,
preferably only resize windows adjacent to EDGE.

If the optional argument CHAR-SIZE is a positive integer, it specifies
the number of pixels by which windows are incrementally resized.
If CHAR-SIZE is nil, this means to use the value of
`frame-char-height' or `frame-char-width' of WINDOW's frame.

This function recursively resizes WINDOW's child windows to fit the
new size.  Make sure that WINDOW is `window--resizable' before
calling this function.  Note that this function does not resize
siblings of WINDOW or WINDOW's parent window.  You have to
eventually call `window-resize-apply' in order to make resizing
actually take effect."
  (when add
    ;; Add DELTA to the new total size of WINDOW.
    (set-window-new-pixel window delta t))

  (let ((sub (window-child window)))
    (cond
     ((not sub))
     ((window-combined-p sub horizontal)
      ;; In an iso-combination resize child windows according to their
      ;; normal sizes.
      (window--resize-child-windows
       window delta horizontal nil ignore trail edge char-size))
     ;; In an ortho-combination resize each child window by DELTA.
     (t
      (while sub
	(window--resize-this-window
	 sub delta horizontal ignore t trail edge char-size)
	(setq sub (window-right sub)))))))