From: Kim F. Storm Date: Wed, 24 Sep 2003 22:55:42 +0000 (+0000) Subject: (window-current-scroll-bars): New defun. X-Git-Tag: ttn-vms-21-2-B4~8741 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=22f9c48c8299d370be8b504525f096a6ef321f46;p=emacs.git (window-current-scroll-bars): New defun. --- 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.