GNU Emacs Lisp Reference Manual
The window size functions fall into two classes: high-level commands that change the size of windows and low-level functions that access window size. Emacs does not permit overlapping windows or gaps between windows, so resizing one window affects other windows.
window-min-height lines, that window disappears.
If horizontal is non-nil, this function makes
window wider by size columns, stealing columns instead of
lines. If a window from which columns are stolen shrinks below
window-min-width columns, that window disappears.
If the requested size would exceed that of the window's frame, then the function makes the window occupy the entire height (or width) of the frame.
If size is negative, this function shrinks the window by
-size lines or columns. If that makes the window smaller
than the minimum size (window-min-height and
window-min-width), enlarge-window deletes the window.
enlarge-window returns nil.
(defun enlarge-window-horizontally (columns) (enlarge-window columns t))
enlarge-window but negates the argument
size, making the selected window smaller by giving lines (or
columns) to the other windows. If the window shrinks below
window-min-height or window-min-width, then it disappears.
If size is negative, the window is enlarged by -size lines or columns.
(defun shrink-window-horizontally (columns) (shrink-window columns t))
The following two variables constrain the window-size-changing functions to a minimum height and width.
window-min-height automatically deletes it, and no window may be
created shorter than this. The absolute minimum height is two (allowing
one line for the mode line, and one line for the buffer display).
Actions that change window sizes reset this variable to two if it is
less than two. The default value is 4.
window-min-width automatically deletes it, and no window may be
created narrower than this. The absolute minimum width is one; any
value below that is ignored. The default value is 10.
Each function receives the frame as its sole argument. There is no direct way to find out which windows changed size, or precisely how; however, if your size-change function keeps track, after each change, of the windows that interest you, you can figure out what has changed by comparing the old size data with the new.
Creating or deleting windows counts as a size change, and therefore causes these functions to be called. Changing the frame size also counts, because it changes the sizes of the existing windows.
It is not a good idea to use save-window-excursion in these
functions, because that always counts as a size change, and it would
cause these functions to be called over and over. In most cases,
save-selected-window is what you need here.