Function: set-window-scroll-bars

set-window-scroll-bars is a function defined in window.c.

Signature

(set-window-scroll-bars WINDOW &optional WIDTH VERTICAL-TYPE HEIGHT HORIZONTAL-TYPE PERSISTENT)

Documentation

Set width and type of scroll bars of specified WINDOW.

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

Second argument WIDTH specifies the pixel width for the vertical scroll bar. If WIDTH is nil, use the scroll bar width of WINDOW's frame. Third argument VERTICAL-TYPE specifies the type of the vertical scroll bar: left, right, nil or t where nil means to not display a vertical scroll bar on WINDOW and t means to use WINDOW frame's vertical scroll bar type.

Fourth argument HEIGHT specifies the pixel height for the horizontal scroll bar. If HEIGHT is nil, use the scroll bar height of WINDOW's frame. Fifth argument HORIZONTAL-TYPE specifies the type of the horizontal scroll bar: bottom, nil, or t where nil means to not display a horizontal scroll bar on WINDOW and t means to use WINDOW frame's horizontal scroll bar type. If WINDOW is a mini window, t effectively behaves like nil. HORIZONTAL-TYPE must equal bottom in order to show a scroll bar for mini windows.

Optional sixth argument PERSISTENT non-nil means that scroll bar settings for WINDOW are persistent, i.e., remain unchanged when another buffer is shown in WINDOW. PERSISTENT nil means that scroll bars are reset from buffer local values when set-window-buffer is called on WINDOW with the argument KEEP-MARGINS nil.

If WINDOW is not large enough to accommodate a scroll bar of the desired dimension, leave the corresponding scroll bar unchanged. Return t if scroll bars were actually changed and nil otherwise.

View in manual

Probably introduced at or before Emacs version 22.1.

Source Code

// Defined in /usr/src/emacs/src/window.c
{
  struct window *w
    = set_window_scroll_bars (decode_live_window (window),
			      width, vertical_type, height,
			      horizontal_type, persistent);
  return w ? (apply_window_adjustment (w), Qt) : Qnil;
}