+ 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 the fringe widths of window WINDOW.
+If WINDOW is nil, set the fringe widths of the currently selected
+window.
+Second arg LEFT-WIDTH specifies the number of pixels to reserve for
+the left fringe. Optional third arg RIGHT-WIDTH specifies the right
+fringe width. If a fringe width arg is nil, that means to use the
+frame's default fringe width. Default fringe widths can be set with
+the command `set-fringe-style'.
+If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes
+outside of the display margins. By default, fringes are drawn between
+display marginal areas and the text area. */)
+ (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). */)
+ (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.
+If WIDTH is nil, use the frame's scroll-bar width.
+If TYPE is t, use the frame's scroll-bar type. */)
+ (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 (vertical_type, Qnil)
+ || EQ (vertical_type, Qleft)
+ || EQ (vertical_type, Qright)
+ || EQ (vertical_type, Qt)))
+ error ("Invalid type of vertical scroll bar");
+
+ 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).
+If WIDTH is nil or TYPE is t, the window is using the frame's corresponding
+value. */)
+ (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))));