Next: Window Dividers, Previous: Fringes, Up: Display
Normally the frame parameter vertical-scroll-bars
controls
whether the windows in the frame have vertical scroll bars, and
whether they are on the left or right. The frame parameter
scroll-bar-width
specifies how wide they are (nil
meaning the default). See Layout Parameters.
This function reports the scroll bar type settings for frame frame. The value is a cons cell
(
vertical-type.
horizontal-type)
, where vertical-type is eitherleft
,right
, ornil
(which means no scroll bar.) horizontal-type is meant to specify the horizontal scroll bar type, but since they are not implemented, it is alwaysnil
.
You can enable or disable scroll bars for a particular buffer,
by setting the variable vertical-scroll-bar
. This variable
automatically becomes buffer-local when set. The possible values are
left
, right
, t
, which means to use the
frame's default, and nil
for no scroll bar.
You can also control this for individual windows. Call the function
set-window-scroll-bars
to specify what to do for a specific window:
This function sets the width and type of scroll bars for window window.
width specifies the scroll bar width in pixels (
nil
means use the width specified for the frame). vertical-type specifies whether to have a vertical scroll bar and, if so, where. The possible values areleft
,right
andnil
, just like the values of thevertical-scroll-bars
frame parameter.The argument horizontal-type is meant to specify whether and where to have horizontal scroll bars, but since they are not implemented, it has no effect. If window is
nil
, the selected window is used.
Report the width and type of scroll bars specified for window. If window is omitted or
nil
, the selected window is used. The value is a list of the form(
width cols vertical-type horizontal-type)
. The value width is the value that was specified for the width (which may benil
); cols is the number of columns that the scroll bar actually occupies.horizontal-type is not actually meaningful.
This function returns the width in pixels of window's vertical scrollbar. window must be a live window, and defaults to the selected window.
If you don't specify these values for a window with
set-window-scroll-bars
, the buffer-local variables
scroll-bar-mode
and scroll-bar-width
in the buffer being
displayed control the window's vertical scroll bars. The function
set-window-buffer
examines these variables. If you change them
in a buffer that is already visible in a window, you can make the
window take note of the new values by calling set-window-buffer
specifying the same buffer that is already displayed.
This variable, always local in all buffers, controls whether and where to put scroll bars in windows displaying the buffer. The possible values are
nil
for no scroll bar,left
to put a scroll bar on the left, andright
to put a scroll bar on the right.
This function reports the scroll bar type for window window. If window is omitted or
nil
, the selected window is used. The value is a cons cell(
vertical-type.
horizontal-type)
. Unlikewindow-scroll-bars
, this reports the scroll bar type actually used, once frame defaults andscroll-bar-mode
are taken into account.