;;; scroll-bar.el --- window system-independent scroll bar support
-;; Copyright (C) 1993-1995, 1999-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 1999-2013 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: hardware
;;; Code:
(require 'mouse)
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
\f
;;;; Utilities.
;; If it is set again, that is for real.
(setq scroll-bar-mode-explicit t)
-(defun get-scroll-bar-mode () scroll-bar-mode)
-(defsetf get-scroll-bar-mode set-scroll-bar-mode)
+(defun get-scroll-bar-mode ()
+ (declare (gv-setter set-scroll-bar-mode))
+ scroll-bar-mode)
(define-minor-mode scroll-bar-mode
"Toggle vertical scroll bars on all frames (Scroll Bar mode).
This command applies to all frames that exist and frames to be
created in the future."
- :variable (eq (get-scroll-bar-mode)
- (or previous-scroll-bar-mode
- default-frame-scroll-bars)))
+ :variable ((get-scroll-bar-mode)
+ . (lambda (v) (set-scroll-bar-mode
+ (if v (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.