diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2006-12-30 15:23:24 +0000 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2006-12-30 15:23:24 +0000 |
commit | f62c3ee2001790189c37ff7ec53586ffabfd0ecb (patch) | |
tree | 8d8c506a62d967de25e90bcc1fedd71028bafe04 /lisp/scroll-bar.el | |
parent | 0fb7324a4d1327224aae0b4364e9194ae36dac86 (diff) | |
download | emacs-f62c3ee2001790189c37ff7ec53586ffabfd0ecb.tar.gz |
(previous-scroll-bar-mode): New variable
(set-scroll-bar-mode): Set previous-scroll-bar-mode.
(scroll-bar-mode): Use previous-scroll-bar-mode if set.
Diffstat (limited to 'lisp/scroll-bar.el')
-rw-r--r-- | lisp/scroll-bar.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index 69d696f7741..438aa8f14dd 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -75,6 +75,7 @@ SIDE must be the symbol `left' or `right'." ;;;; Helpful functions for enabling and disabling scroll bars. (defvar scroll-bar-mode) +(defvar previous-scroll-bar-mode nil) (defvar scroll-bar-mode-explicit nil "Non-nil means `set-scroll-bar-mode' should really do something. @@ -85,6 +86,9 @@ This is nil while loading `scroll-bar.el', and t afterward.") (defun set-scroll-bar-mode (value) "Set `scroll-bar-mode' to VALUE and put the new value into effect." + (if scroll-bar-mode + (setq previous-scroll-bar-mode scroll-bar-mode)) + (setq scroll-bar-mode value) (when scroll-bar-mode-explicit @@ -137,7 +141,8 @@ turn off scroll bars; otherwise, turn on scroll bars." (not scroll-bar-mode) (setq flag (prefix-numeric-value flag)) (or (not (numberp flag)) (>= flag 0))) - default-frame-scroll-bars))) + (or previous-scroll-bar-mode + default-frame-scroll-bars)))) (defun toggle-scroll-bar (arg) "Toggle whether or not the selected frame has vertical scroll bars. |