Function: window-scroll-bars

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

Signature

(window-scroll-bars &optional WINDOW)

Documentation

Get width and type of scroll bars of window WINDOW.

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

Value is a list of the form (WIDTH COLUMNS VERTICAL-TYPE HEIGHT LINES HORIZONTAL-TYPE PERSISTENT). WIDTH reports the pixel width of the vertical scroll bar; COLUMNS is the equivalent number of columns. Similarly, HEIGHT and LINES are the height of the horizontal scroll bar in pixels and the equivalent number of lines. VERTICAL-TYPE reports the type of the vertical scroll bar, either left, right, nil, or t. HORIZONTAL-TYPE reports the type of the horizontal scroll bar, either bottom, nil or t. PERSISTENT reports the value specified by the last successful call to set-window-scroll-bars, or nil if there was none.

If WIDTH or HEIGHT is nil or VERTICAL-TYPE or HORIZONTAL-TYPE is t, WINDOW is using the corresponding value specified for the frame.

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 = decode_live_window (window);

  return Fcons (((w->scroll_bar_width >= 0)
		 ? make_fixnum (w->scroll_bar_width)
		 : Qnil),
		Fcons (make_fixnum (WINDOW_SCROLL_BAR_COLS (w)),
		       list5 (w->vertical_scroll_bar_type,
			      ((w->scroll_bar_height >= 0)
			       ? make_fixnum (w->scroll_bar_height)
			       : Qnil),
			      make_fixnum (WINDOW_SCROLL_BAR_LINES (w)),
			      w->horizontal_scroll_bar_type,
			      w->scroll_bars_persistent ? Qt : Qnil)));
}