Function: set-window-margins

set-window-margins is a function defined in window.c.

Signature

(set-window-margins WINDOW LEFT-WIDTH &optional RIGHT-WIDTH)

Documentation

Set width of marginal areas of window WINDOW.

WINDOW must be a live window and defaults to the selected one.

Second arg LEFT-WIDTH specifies the number of character cells to reserve for the left marginal area. Optional third arg RIGHT-WIDTH does the same for the right marginal area. A nil width parameter means no margin.

Leave margins unchanged if WINDOW is not large enough to accommodate margins of the desired width. Return t if any margin was actually changed and nil otherwise.

The margins specified by calling this function may be later overridden by invoking set-window-buffer for the same WINDOW, with its KEEP-MARGINS argument nil or omitted.

View in manual

Probably introduced at or before Emacs version 21.1.

Source Code

// Defined in /usr/src/emacs/src/window.c
{
  struct window *w = set_window_margins (decode_live_window (window),
					 left_width, right_width);
  return w ? (apply_window_adjustment (w), Qt) : Qnil;
}