Function: window-current-scroll-bars

window-current-scroll-bars is a byte-compiled function defined in window.el.gz.

Signature

(window-current-scroll-bars &optional WINDOW)

Documentation

Return the current scroll bar types for WINDOW.

WINDOW must be a live window and defaults to the selected one.

The return value is a cons cell (VERTICAL . HORIZONTAL) where VERTICAL specifies the current location of the vertical scroll bar (left, right or nil), and HORIZONTAL specifies the current location of the horizontal scroll bar (bottom or nil).

Unlike window-scroll-bars, this function reports the scroll bar type actually used, once frame defaults and scroll-bar-mode(var)/scroll-bar-mode(fun) are taken into account.

Probably introduced at or before Emacs version 22.1.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window-current-scroll-bars (&optional window)
  "Return the current scroll bar types for WINDOW.
WINDOW must be a live window and defaults to the selected one.

The return value is a cons cell (VERTICAL . HORIZONTAL) where
VERTICAL specifies the current location of the vertical scroll
bar (`left', `right' or nil), and HORIZONTAL specifies the
current location of the horizontal scroll bar (`bottom' or nil).

Unlike `window-scroll-bars', this function reports the scroll bar
type actually used, once frame defaults and `scroll-bar-mode' are
taken into account."
  (setq window (window-normalize-window window t))
  (let ((vertical (nth 2 (window-scroll-bars window)))
	(horizontal (nth 5 (window-scroll-bars window)))
	(inherited (frame-current-scroll-bars (window-frame window))))
    (when (eq vertical t)
      (setq vertical (car inherited)))
    (when (eq horizontal t)
      (setq horizontal (cdr inherited)))
    (cons vertical (and horizontal 'bottom))))