+ return Fcons (w->left_margin_cols, w->right_margin_cols);
+}
+
+
+\f
+/***********************************************************************
+ Fringes
+ ***********************************************************************/
+
+DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes,
+ 2, 4, 0,
+ doc: /* Set width of fringes of window WINDOW.
+
+If window is nil, set fringes of the currently selected window.
+Second parameter LEFT-WIDTH specifies the number of pixels to reserve
+for the left fringe. Third parameter RIGHT-WIDTH does the same for
+the right fringe. Fourth parameter OUTSIDE-MARGINS non-nil specifies
+that fringes are drawn outside of the display margins; by default, fringes
+are drawn between display marginal areas and the text area.
+A nil width parameter means to use the frame's corresponding fringe width. */)
+ (window, left, right, outside_margins)
+ Lisp_Object window, left, right, outside_margins;
+{
+ struct window *w = decode_window (window);
+
+ if (!NILP (left))
+ CHECK_NUMBER (left);
+ if (!NILP (right))
+ CHECK_NUMBER (right);
+
+ if (!EQ (w->left_fringe_width, left)
+ || !EQ (w->right_fringe_width, right)
+ || !EQ (w->fringes_outside_margins, outside_margins))
+ {
+ w->left_fringe_width = left;
+ w->right_fringe_width = right;
+ w->fringes_outside_margins = outside_margins;
+
+ adjust_window_margins (w);
+
+ clear_glyph_matrix (w->current_matrix);
+ w->window_end_valid = Qnil;
+
+ ++windows_or_buffers_changed;
+ adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
+ }
+
+ return Qnil;
+}
+
+
+DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes,
+ 0, 1, 0,
+ doc: /* Get width of fringes of window WINDOW.
+If WINDOW is omitted or nil, use the currently selected window.
+Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS).
+If a window specific fringe width is not set, its width will be returned
+as nil. */)
+ (window)
+ Lisp_Object window;
+{
+ struct window *w = decode_window (window);
+ return Fcons (make_number (WINDOW_LEFT_FRINGE_WIDTH (w)),
+ Fcons (make_number (WINDOW_RIGHT_FRINGE_WIDTH (w)),
+ Fcons ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) ?
+ Qt : Qnil), Qnil)));
+}
+
+
+\f
+/***********************************************************************
+ Scroll bars
+ ***********************************************************************/
+
+DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars, Sset_window_scroll_bars,
+ 2, 4, 0,
+ doc: /* Set width and type of scroll bars of window WINDOW.
+If window is nil, set scroll bars of the currently selected window.
+Second parameter WIDTH specifies the pixel width for the scroll bar;
+this is automatically adjusted to a multiple of the frame column width.
+Third parameter VERTICAL-TYPE specifies the type of the vertical scroll
+bar: left, right, or nil.
+A width of nil and type of t means to use the frame's corresponding value. */)
+ (window, width, vertical_type, horizontal_type)
+ Lisp_Object window, width, vertical_type, horizontal_type;
+{
+ struct window *w = decode_window (window);
+
+ if (!NILP (width))
+ CHECK_NUMBER (width);
+
+ if (XINT (width) == 0)
+ vertical_type = Qnil;
+
+ if (!EQ (w->scroll_bar_width, width)
+ || !EQ (w->vertical_scroll_bar_type, vertical_type))
+ {
+ w->scroll_bar_width = width;
+ w->vertical_scroll_bar_type = vertical_type;
+
+ adjust_window_margins (w);
+
+ clear_glyph_matrix (w->current_matrix);
+ w->window_end_valid = Qnil;
+
+ ++windows_or_buffers_changed;
+ adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
+ }
+
+ return Qnil;
+}
+
+
+DEFUN ("window-scroll-bars", Fwindow_scroll_bars, Swindow_scroll_bars,
+ 0, 1, 0,
+ doc: /* Get width and type of scroll bars of window WINDOW.
+If WINDOW is omitted or nil, use the currently selected window.
+Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE). */)
+ (window)
+ Lisp_Object window;
+{
+ struct window *w = decode_window (window);
+ return Fcons (make_number ((WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)
+ ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)
+ : WINDOW_SCROLL_BAR_AREA_WIDTH (w))),
+ Fcons (make_number (WINDOW_SCROLL_BAR_COLS (w)),
+ Fcons (w->vertical_scroll_bar_type,
+ Fcons (Qnil, Qnil))));