+(defvar scroll-bar-mode)
+(defvar previous-scroll-bar-mode nil)
+
+(defvar scroll-bar-mode-explicit nil
+ "Non-nil means `set-scroll-bar-mode' should really do something.
+This is nil while loading `scroll-bar.el', and t afterward.")
+
+(defun set-scroll-bar-mode-1 (ignore value)
+ (set-scroll-bar-mode value))
+
+(defun set-scroll-bar-mode (value)
+ "Set `scroll-bar-mode' to VALUE and put the new value into effect."
+ (if scroll-bar-mode
+ (setq previous-scroll-bar-mode scroll-bar-mode))
+
+ (setq scroll-bar-mode value)
+
+ (when scroll-bar-mode-explicit
+ (modify-all-frames-parameters (list (cons 'vertical-scroll-bars
+ scroll-bar-mode)))))
+
+(defcustom scroll-bar-mode default-frame-scroll-bars
+ "Specify whether to have vertical scroll bars, and on which side.
+Possible values are nil (no scroll bars), `left' (scroll bars on left)
+and `right' (scroll bars on right).
+To set this variable in a Lisp program, use `set-scroll-bar-mode'
+to make it take real effect.
+Setting the variable with a customization buffer also takes effect."
+ :type '(choice (const :tag "none (nil)" nil)
+ (const left)
+ (const right))
+ :group 'frames
+ ;; The default value for :initialize would try to use :set
+ ;; when processing the file in cus-dep.el.
+ :initialize 'custom-initialize-default
+ :set 'set-scroll-bar-mode-1)
+
+;; We just set scroll-bar-mode, but that was the default.
+;; If it is set again, that is for real.
+(setq scroll-bar-mode-explicit t)
+
+(defun scroll-bar-mode (&optional flag)
+ "Toggle display of vertical scroll bars on all frames.