Commit ada464a7 authored by Jim Blandy's avatar Jim Blandy
Browse files

* scroll-bar.el (scroll-bar-mode): Variable deleted.

	(scroll-bar-mode): Function changed to consult default-frame-alist
	instead of the variable.
parent 1c595d45
......@@ -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,8 +56,17 @@ created in the future.
With a numeric argument, if the argument is negative,
turn off scroll bars; otherwise, turn on scroll bars."
(interactive "P")
;; 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.
(lambda (param-name)
......@@ -71,13 +77,15 @@ turn off scroll bars; otherwise, turn on scroll bars."
(cons (cons param-name scroll-bar-mode)
'(vertical-scroll-bars horizontal-scroll-bars))
;; Apply it to existing frames.
(let ((frames (frame-list)))
(while frames
(car frames)
(list (cons 'vertical-scroll-bars scroll-bar-mode)
(cons 'horizontal-scroll-bars scroll-bar-mode)))
(setq frames (cdr frames)))))
(setq frames (cdr frames))))))
;;;; Buffer navigation using the scroll bar.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment