diff options
author | Jim Blandy <jimb@redhat.com> | 1993-06-10 12:18:36 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1993-06-10 12:18:36 +0000 |
commit | ada464a7f3ffe0213d412196a14d9bb02e3531cb (patch) | |
tree | 080c2fc446edb19cb20ad58a195b06eeeb30a296 /lisp/scroll-bar.el | |
parent | 1c595d45c4f707f324e80a593cb7ca4b4391cfed (diff) | |
download | emacs-ada464a7f3ffe0213d412196a14d9bb02e3531cb.tar.gz |
* scroll-bar.el (scroll-bar-mode): Variable deleted.
(scroll-bar-mode): Function changed to consult default-frame-alist
instead of the variable.
Diffstat (limited to 'lisp/scroll-bar.el')
-rw-r--r-- | lisp/scroll-bar.el | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index 3e30e1b5e7d..8fd62f02898 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -48,9 +48,6 @@ that scroll bar position." ;;;; Helpful functions for enabling and disabling scroll bars. -;;; This is not documented because you can't change the -;;; mode properly by setting it. -(defvar scroll-bar-mode t) (defun scroll-bar-mode (flag) "Toggle display of vertical scroll bars on each frame. @@ -59,25 +56,36 @@ created in the future. With a numeric argument, if the argument is negative, turn off scroll bars; otherwise, turn on scroll bars." (interactive "P") - (setq scroll-bar-mode (if (null flag) (not scroll-bar-mode) - (or (not (numberp flag)) (>= flag 0)))) - (mapcar - (function - (lambda (param-name) - (let ((parameter (assq param-name default-frame-alist))) - (if (consp parameter) - (setcdr parameter scroll-bar-mode) - (setq default-frame-alist - (cons (cons param-name scroll-bar-mode) - default-frame-alist)))))) - '(vertical-scroll-bars horizontal-scroll-bars)) - (let ((frames (frame-list))) - (while frames - (modify-frame-parameters - (car frames) - (list (cons 'vertical-scroll-bars scroll-bar-mode) - (cons 'horizontal-scroll-bars scroll-bar-mode))) - (setq frames (cdr frames))))) + + ;; Obtain the current setting by looking at default-frame-alist. + (let ((scroll-bar-mode + (let ((assq (assq 'vertical-scroll-bars default-frame-alist))) + (if assq (cdr assq) t)))) + + ;; Tweedle it according to the argument. + (setq scroll-bar-mode (if (null flag) (not scroll-bar-mode) + (or (not (numberp flag)) (>= flag 0)))) + + ;; Apply it to default-frame-alist. + (mapcar + (function + (lambda (param-name) + (let ((parameter (assq param-name default-frame-alist))) + (if (consp parameter) + (setcdr parameter scroll-bar-mode) + (setq default-frame-alist + (cons (cons param-name scroll-bar-mode) + default-frame-alist)))))) + '(vertical-scroll-bars horizontal-scroll-bars)) + + ;; Apply it to existing frames. + (let ((frames (frame-list))) + (while frames + (modify-frame-parameters + (car frames) + (list (cons 'vertical-scroll-bars scroll-bar-mode) + (cons 'horizontal-scroll-bars scroll-bar-mode))) + (setq frames (cdr frames)))))) ;;;; Buffer navigation using the scroll bar. |