summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2003-09-24 22:55:42 +0000
committerKim F. Storm <storm@cua.dk>2003-09-24 22:55:42 +0000
commit9b4bcdb3ed019b0d739e66094ec68f97efc1c378 (patch)
treeb6adb065498170e09bd704195737176aaa6b88af /lisp/window.el
parent7d63ae24772f400a6eb8cc92ff1406d96f84ee94 (diff)
downloademacs-9b4bcdb3ed019b0d739e66094ec68f97efc1c378.tar.gz
(window-current-scroll-bars): New defun.
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 2cfc254b220..c4ae59e148f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -75,6 +75,23 @@ If ALL-FRAMES is neither nil nor t, count only the selected frame."
(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.