aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-02-25 00:38:55 +0000
committerJim Blandy1993-02-25 00:38:55 +0000
commitfe48f821caa8b9bd09996cf7bdbdfcf12b58a1fb (patch)
treee00502d7241d3d70c041851bd7b934149b000d0d
parentc922bc55143f0d9a8632e96eaa23c1e58c8d25eb (diff)
downloademacs-fe48f821caa8b9bd09996cf7bdbdfcf12b58a1fb.tar.gz
emacs-fe48f821caa8b9bd09996cf7bdbdfcf12b58a1fb.zip
* term/x-win.el (scroll-bar-mode, scroll-bar-mode): Move these
functions to scrolbar.el. * scrollbar.el (scroll-bar-mode, scroll-bar-mode): Here they are. Make scroll-bar-mode set the {vertical,horizontal}-scrollbars parameters in default-frame-alist, and modify all extant screens using the correct parameter names.
-rw-r--r--lisp/scroll-bar.el30
-rw-r--r--lisp/term/x-win.el19
2 files changed, 30 insertions, 19 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index e0d38e3d30c..63b37a59145 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -39,6 +39,36 @@ that scrollbar position."
39 (truncate (/ (* (float (car num-denom)) whole) (cdr num-denom)))) 39 (truncate (/ (* (float (car num-denom)) whole) (cdr num-denom))))
40 40
41 41
42;;;; Helpful functions for enabling and disabling scroll bars.
43(defvar scroll-bar-mode nil)
44
45(defun scroll-bar-mode (flag)
46 "Toggle display of vertical scroll bars on each frame.
47This command applies to all frames that exist and frames to be
48created in the future.
49With a numeric argument, if the argument is negative,
50turn off scroll bars; otherwise, turn on scroll bars."
51 (interactive "P")
52 (setq scroll-bar-mode (if (null flag) (not scroll-bar-mode)
53 (or (not (numberp flag)) (>= flag 0))))
54 (mapcar
55 (function
56 (lambda (param-name)
57 (let ((parameter (assq param-name default-frame-alist)))
58 (if (consp parameter)
59 (setcdr parameter scroll-bar-mode)
60 (setq default-frame-alist
61 (cons (cons param-name scroll-bar-mode)
62 default-frame-alist))))))
63 '(vertical-scrollbars horizontal-scrollbars))
64 (let ((frames (frame-list)))
65 (while frames
66 (modify-frame-parameters
67 (car frames)
68 (list (cons 'vertical-scrollbars scroll-bar-mode)
69 (cons 'horizontal-scrollbars scroll-bar-mode)))
70 (setq frames (cdr frames)))))
71
42;;;; Buffer navigation using the scrollbar. 72;;;; Buffer navigation using the scrollbar.
43 73
44(defun scrollbar-set-window-start (event) 74(defun scrollbar-set-window-start (event)
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index e918a68f7e1..0c9210a410d 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -415,25 +415,6 @@ This returns ARGS with the arguments that have been processed removed."
415 (setq defined-colors (cons this-color defined-colors)))) 415 (setq defined-colors (cons this-color defined-colors))))
416 defined-colors)) 416 defined-colors))
417 417
418(defvar scroll-bar-mode nil)
419
420;;; ??? x-create-screen needs to be changed to use scroll-bar-mode
421;;; to decide (by default) whether to make a scroll bar.
422(defun scroll-bar-mode (flag)
423 "Toggle display of vertical scroll bars on each frame.
424This command applies to all frames that exist and frames to be
425created in the future.
426With a numeric argument, if the argument is negative,
427turn off scroll bars; otherwise, turn on scroll bars."
428 (interactive "P")
429 (setq scroll-bar-mode (if (null flag) (not scroll-bar-mode)
430 (or (not (numberp flag)) (>= flag 0))))
431 (let ((frames (frame-list)))
432 (while frames
433 (modify-frame-parameters (car frames)
434 (list (cons 'vertical-scrollbar scroll-bar-mode)))
435 (setq frames (cdr frames)))))
436
437;;;; Function keys 418;;;; Function keys
438 419
439;;; Give some common function keys reasonable definitions. 420;;; Give some common function keys reasonable definitions.