1 |
;;; scroll-bar.el --- window system-independent scroll bar support |
;;; scroll-bar.el --- window system-independent scroll bar support |
2 |
|
|
3 |
;; Copyright (C) 1993, 1994, 1995, 1999, 2000, 2001 |
;; Copyright (C) 1993, 1994, 1995, 1999, 2000, 2001, 2003 |
4 |
;; Free Software Foundation, Inc. |
;; Free Software Foundation, Inc. |
5 |
|
|
6 |
;; Maintainer: FSF |
;; Maintainer: FSF |
88 |
(setq frames (cdr frames)))))) |
(setq frames (cdr frames)))))) |
89 |
|
|
90 |
(defcustom scroll-bar-mode |
(defcustom scroll-bar-mode |
91 |
(if (eq system-type 'windows-nt) 'right 'left) |
(cond ((eq system-type 'windows-nt) 'right) |
92 |
|
((featurep 'mac-carbon) 'right) |
93 |
|
(t 'left)) |
94 |
"*Specify whether to have vertical scroll bars, and on which side. |
"*Specify whether to have vertical scroll bars, and on which side. |
95 |
Possible values are nil (no scroll bars), `left' (scroll bars on left) |
Possible values are nil (no scroll bars), `left' (scroll bars on left) |
96 |
and `right' (scroll bars on right). |
and `right' (scroll bars on right). |
97 |
To set this variable in a Lisp program, use `set-scroll-bar-mode' |
To set this variable in a Lisp program, use `set-scroll-bar-mode' |
98 |
to make it take real effect. |
to make it take real effect. |
99 |
Setting the variable with a customization buffer also takes effect." |
Setting the variable with a customization buffer also takes effect." |
100 |
:type '(choice (const :tag "none (nil)") |
:type '(choice (const :tag "none (nil)" nil) |
101 |
(const left) |
(const left) |
102 |
(const right)) |
(const right)) |
103 |
:group 'frames |
:group 'frames |
104 |
|
;; The default value for :initialize would try to use :set |
105 |
|
;; when processing the file in cus-dep.el. |
106 |
|
:initialize 'custom-initialize-default |
107 |
:set 'set-scroll-bar-mode-1) |
:set 'set-scroll-bar-mode-1) |
108 |
|
|
109 |
;; We just set scroll-bar-mode, but that was the default. |
;; We just set scroll-bar-mode, but that was the default. |
122 |
;; Tweedle the variable according to the argument. |
;; Tweedle the variable according to the argument. |
123 |
(set-scroll-bar-mode (if (null flag) (not scroll-bar-mode) |
(set-scroll-bar-mode (if (null flag) (not scroll-bar-mode) |
124 |
(and (or (not (numberp flag)) (>= flag 0)) |
(and (or (not (numberp flag)) (>= flag 0)) |
125 |
(if (eq system-type 'windows-nt) 'right 'left))))) |
(cond ((eq system-type 'windows-nt) 'right) |
126 |
|
((featurep 'mac-carbon) 'right) |
127 |
|
(t 'left)))))) |
128 |
|
|
129 |
(defun toggle-scroll-bar (arg) |
(defun toggle-scroll-bar (arg) |
130 |
"Toggle whether or not the selected frame has vertical scroll bars. |
"Toggle whether or not the selected frame has vertical scroll bars. |
143 |
(list (cons 'vertical-scroll-bars |
(list (cons 'vertical-scroll-bars |
144 |
(if (> arg 0) |
(if (> arg 0) |
145 |
(or scroll-bar-mode |
(or scroll-bar-mode |
146 |
(if (eq system-type 'windows-nt) 'right 'left))))))) |
(cond ((eq system-type 'windows-nt) 'right) |
147 |
|
((featurep 'mac-carbon) 'right) |
148 |
|
(t 'left)))))))) |
149 |
|
|
150 |
(defun toggle-horizontal-scroll-bar (arg) |
(defun toggle-horizontal-scroll-bar (arg) |
151 |
"Toggle whether or not the selected frame has horizontal scroll bars. |
"Toggle whether or not the selected frame has horizontal scroll bars. |