summaryrefslogtreecommitdiff
path: root/lisp/scroll-bar.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-07-21 05:58:34 +0000
committerRichard M. Stallman <rms@gnu.org>1997-07-21 05:58:34 +0000
commit2124851f281f6c2569bc39d263dd5eb45c31f630 (patch)
tree0b8b24785ee89989c8f0de38289b6e6cb7b334d4 /lisp/scroll-bar.el
parent87b6ab4c4afdb3c264acff6c24970bc7edfd7bdb (diff)
downloademacs-2124851f281f6c2569bc39d263dd5eb45c31f630.tar.gz
(scroll-bar-mode-explicit): New variable.
(set-scroll-bar-mode): Don't alter default-frame-alist when just loading this file.
Diffstat (limited to 'lisp/scroll-bar.el')
-rw-r--r--lisp/scroll-bar.el39
1 files changed, 24 insertions, 15 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index 8e07f3a5f6a..ec02d8c57c9 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -58,25 +58,30 @@ that scroll bar position."
(defvar scroll-bar-mode)
+(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 (ignore value)
"Set `scroll-bar-mode' to VALUE and put the new value into effect."
(setq scroll-bar-mode value)
- ;; Apply it to default-frame-alist.
- (let ((parameter (assq 'vertical-scroll-bars default-frame-alist)))
- (if (consp parameter)
- (setcdr parameter scroll-bar-mode)
- (setq default-frame-alist
- (cons (cons 'vertical-scroll-bars scroll-bar-mode)
- default-frame-alist))))
-
- ;; Apply it to existing frames.
- (let ((frames (frame-list)))
- (while frames
- (modify-frame-parameters
- (car frames)
- (list (cons 'vertical-scroll-bars scroll-bar-mode)))
- (setq frames (cdr frames)))))
+ (when scroll-bar-mode-explicit
+ ;; Apply it to default-frame-alist.
+ (let ((parameter (assq 'vertical-scroll-bars default-frame-alist)))
+ (if (consp parameter)
+ (setcdr parameter scroll-bar-mode)
+ (setq default-frame-alist
+ (cons (cons 'vertical-scroll-bars scroll-bar-mode)
+ default-frame-alist))))
+
+ ;; Apply it to existing frames.
+ (let ((frames (frame-list)))
+ (while frames
+ (modify-frame-parameters
+ (car frames)
+ (list (cons 'vertical-scroll-bars scroll-bar-mode)))
+ (setq frames (cdr frames))))))
(defcustom scroll-bar-mode 'left
"*Specify whether to have vertical scroll bars, and on which side.
@@ -92,6 +97,10 @@ it takes effect immediately for all frames."
:group 'frames
:set 'set-scroll-bar-mode)
+;; 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 (flag)
"Toggle display of vertical scroll bars on all frames.
This command applies to all frames that exist and frames to be