changeset 52615:de1a002c48c7

(window-current-scroll-bars): New defun.
author Kim F. Storm <storm@cua.dk>
date Wed, 24 Sep 2003 22:55:42 +0000
parents a77e35d5d0c2
children 3c1bf15e7a4d
files lisp/window.el
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/window.el	Wed Sep 24 22:54:55 2003 +0000
+++ b/lisp/window.el	Wed Sep 24 22:55:42 2003 +0000
@@ -75,6 +75,23 @@
     (eq base-window
 	(next-window base-window (if nomini 'arg) all-frames))))
 
+(defun window-current-scroll-bars (&optional window)
+  "Return the current scroll-bar settings in window WINDOW.
+Value is a cons (VERTICAL . HORISONTAL) where VERTICAL specifies the
+current location of the vertical scroll-bars (left, right, or nil),
+and HORISONTAL specifies the current location of the horisontal scroll
+bars (top, bottom, or nil)."
+  (let ((vert (nth 2 (window-scroll-bars window)))
+	(hor nil))
+    (when (or (eq vert t) (eq hor t))
+      (let ((fcsb (frame-current-scroll-bars 
+		   (window-frame (or window (selected-window))))))
+	(if (eq vert t)
+	    (setq vert (car fcsb)))
+	(if (eq hor t)
+	    (setq hor (cdr fcsb)))))
+    (cons vert hor)))
+
 (defun walk-windows (proc &optional minibuf all-frames)
   "Cycle through all visible windows, calling PROC for each one.
 PROC is called with a window as argument.