Function: window-with-parameter

window-with-parameter is a byte-compiled function defined in window.el.gz.

Signature

(window-with-parameter PARAMETER &optional VALUE FRAME ANY MINIBUF)

Documentation

Return first window on FRAME with PARAMETER non-nil.

FRAME defaults to the selected frame. Optional argument VALUE non-nil means only return a window whose window-parameter value for PARAMETER equals VALUE (comparison is done with equal). Optional argument ANY non-nil means consider internal windows too.

Optional argument MINIBUF t means consider FRAME's minibuffer window even if it isn't active. MINIBUF nil or omitted means consider FRAME's minibuffer window only if it's active. In both cases the minibuffer window must be part of FRAME. MINIBUF neither nil nor t means never consider the minibuffer window.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window-with-parameter (parameter &optional value frame any minibuf)
  "Return first window on FRAME with PARAMETER non-nil.
FRAME defaults to the selected frame.  Optional argument VALUE
non-nil means only return a window whose `window-parameter' value
for PARAMETER equals VALUE (comparison is done with `equal').
Optional argument ANY non-nil means consider internal windows
too.

Optional argument MINIBUF t means consider FRAME's minibuffer
window even if it isn't active.  MINIBUF nil or omitted means
consider FRAME's minibuffer window only if it's active.  In both
cases the minibuffer window must be part of FRAME.  MINIBUF
neither nil nor t means never consider the minibuffer window."
  (let (this-value)
    (catch 'found
      (walk-window-tree
       (lambda (window)
	 (when (and (setq this-value (window-parameter window parameter))
		    (or (not value) (equal value this-value)))
	   (throw 'found window)))
       frame any minibuf))))