# HG changeset patch # User Jan Dj¸«£rv # Date 1167492204 0 # Node ID 3b9c6c0ac7440137e97a1ca2e85f6eb19047dc07 # Parent caf623b2b269a94dff49817fe6c60c2cdc76ddd9 (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. diff -r caf623b2b269 -r 3b9c6c0ac744 lisp/scroll-bar.el --- a/lisp/scroll-bar.el Sat Dec 30 15:23:09 2006 +0000 +++ b/lisp/scroll-bar.el Sat Dec 30 15:23:24 2006 +0000 @@ -75,6 +75,7 @@ ;;;; 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 @@ (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 @@ (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.