Function: set-window-new-pixel

set-window-new-pixel is a function defined in window.c.

Signature

(set-window-new-pixel WINDOW SIZE &optional ADD)

Documentation

Set new pixel size of WINDOW to SIZE.

WINDOW must be a valid window and defaults to the selected one. Return SIZE.

Optional argument ADD non-nil means add SIZE to the new pixel size of WINDOW and return the sum.

The new pixel size of WINDOW, if valid, will be shortly installed as WINDOW's pixel height (see window-pixel-height) or pixel width (see window-pixel-width).

Note: This function does not operate on any child windows of WINDOW.

Source Code

// Defined in /usr/src/emacs/src/window.c
{
  struct window *w = decode_valid_window (window);
  EMACS_INT size_min = NILP (add) ? 0 : - XFIXNUM (w->new_pixel);
  EMACS_INT size_max = size_min + min (INT_MAX, MOST_POSITIVE_FIXNUM);

  int checked_size = check_integer_range (size, size_min, size_max);
  if (NILP (add))
    wset_new_pixel (w, size);
  else
    wset_new_pixel (w, make_fixnum (XFIXNUM (w->new_pixel) + checked_size));

  return w->new_pixel;
}