aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1997-07-21 05:58:34 +0000
committerRichard M. Stallman1997-07-21 05:58:34 +0000
commit2124851f281f6c2569bc39d263dd5eb45c31f630 (patch)
tree0b8b24785ee89989c8f0de38289b6e6cb7b334d4 /lisp
parent87b6ab4c4afdb3c264acff6c24970bc7edfd7bdb (diff)
downloademacs-2124851f281f6c2569bc39d263dd5eb45c31f630.tar.gz
emacs-2124851f281f6c2569bc39d263dd5eb45c31f630.zip
(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')
-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."
58 58
59(defvar scroll-bar-mode) 59(defvar scroll-bar-mode)
60 60
61(defvar scroll-bar-mode-explicit nil
62 "Non-nil means `set-scroll-bar-mode' should really do something.
63This is nil while loading `scroll-bar.el', and t afterward.")
64
61(defun set-scroll-bar-mode (ignore value) 65(defun set-scroll-bar-mode (ignore value)
62 "Set `scroll-bar-mode' to VALUE and put the new value into effect." 66 "Set `scroll-bar-mode' to VALUE and put the new value into effect."
63 (setq scroll-bar-mode value) 67 (setq scroll-bar-mode value)
64 68
65 ;; Apply it to default-frame-alist. 69 (when scroll-bar-mode-explicit
66 (let ((parameter (assq 'vertical-scroll-bars default-frame-alist))) 70 ;; Apply it to default-frame-alist.
67 (if (consp parameter) 71 (let ((parameter (assq 'vertical-scroll-bars default-frame-alist)))
68 (setcdr parameter scroll-bar-mode) 72 (if (consp parameter)
69 (setq default-frame-alist 73 (setcdr parameter scroll-bar-mode)
70 (cons (cons 'vertical-scroll-bars scroll-bar-mode) 74 (setq default-frame-alist
71 default-frame-alist)))) 75 (cons (cons 'vertical-scroll-bars scroll-bar-mode)
72 76 default-frame-alist))))
73 ;; Apply it to existing frames. 77
74 (let ((frames (frame-list))) 78 ;; Apply it to existing frames.
75 (while frames 79 (let ((frames (frame-list)))
76 (modify-frame-parameters 80 (while frames
77 (car frames) 81 (modify-frame-parameters
78 (list (cons 'vertical-scroll-bars scroll-bar-mode))) 82 (car frames)
79 (setq frames (cdr frames))))) 83 (list (cons 'vertical-scroll-bars scroll-bar-mode)))
84 (setq frames (cdr frames))))))
80 85
81(defcustom scroll-bar-mode 'left 86(defcustom scroll-bar-mode 'left
82 "*Specify whether to have vertical scroll bars, and on which side. 87 "*Specify whether to have vertical scroll bars, and on which side.
@@ -92,6 +97,10 @@ it takes effect immediately for all frames."
92 :group 'frames 97 :group 'frames
93 :set 'set-scroll-bar-mode) 98 :set 'set-scroll-bar-mode)
94 99
100;; We just set scroll-bar-mode, but that was the default.
101;; If it is set again, that is for real.
102(setq scroll-bar-mode-explicit t)
103
95(defun scroll-bar-mode (flag) 104(defun scroll-bar-mode (flag)
96 "Toggle display of vertical scroll bars on all frames. 105 "Toggle display of vertical scroll bars on all frames.
97This command applies to all frames that exist and frames to be 106This command applies to all frames that exist and frames to be