]> git.eshelyaron.com Git - emacs.git/commitdiff
(set-scroll-bar-mode): Initialize to new built-in variable
authorKim F. Storm <storm@cua.dk>
Sat, 20 Sep 2003 23:33:37 +0000 (23:33 +0000)
committerKim F. Storm <storm@cua.dk>
Sat, 20 Sep 2003 23:33:37 +0000 (23:33 +0000)
default-frame-scroll-bars.
(scroll-bar-mode): Use default-frame-scroll-bars when enabling
scroll-bar-mode; notably, use it instead of t when we toggle
scroll-bars on.
(toggle-scroll-bar): Use default-frame-scroll-bars.

lisp/scroll-bar.el

index 7cb57906c67368dd8aa0025ce28edaa7d59931d2..a2f2d22da5dcf516360286f9bd8276ba7557e867 100644 (file)
@@ -87,10 +87,7 @@ This is nil while loading `scroll-bar.el', and t afterward.")
         (list (cons 'vertical-scroll-bars scroll-bar-mode)))
        (setq frames (cdr frames))))))
 
-(defcustom scroll-bar-mode
-  (cond ((eq system-type 'windows-nt) 'right)
-       ((featurep 'mac-carbon) 'right)
-       (t 'left))
+(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).
@@ -117,14 +114,13 @@ created in the future.
 With a numeric argument, if the argument is negative,
 turn off scroll bars; otherwise, turn on scroll bars."
   (interactive "P")
-  (if flag (setq flag (prefix-numeric-value flag)))
 
   ;; Tweedle the variable according to the argument.
-  (set-scroll-bar-mode (if (null flag) (not scroll-bar-mode)
-                        (and (or (not (numberp flag)) (>= flag 0))
-                             (cond ((eq system-type 'windows-nt) 'right)
-                                   ((featurep 'mac-carbon) 'right)
-                                   (t 'left))))))
+  (set-scroll-bar-mode (if (if (null flag) 
+                              (not scroll-bar-mode)
+                            (setq flag (prefix-numeric-value flag))
+                            (or (not (numberp flag)) (>= flag 0)))
+                          default-frame-scroll-bars)))
 
 (defun toggle-scroll-bar (arg)
   "Toggle whether or not the selected frame has vertical scroll bars.
@@ -142,10 +138,7 @@ when they are turned on; if it is nil, they go on the left."
    (selected-frame)
    (list (cons 'vertical-scroll-bars
               (if (> arg 0)
-                  (or scroll-bar-mode
-                      (cond ((eq system-type 'windows-nt) 'right)
-                            ((featurep 'mac-carbon) 'right)
-                            (t 'left))))))))
+                  (or scroll-bar-mode default-frame-scroll-bars))))))
 
 (defun toggle-horizontal-scroll-bar (arg)
   "Toggle whether or not the selected frame has horizontal scroll bars.