From ba27aa4c530c338b04c1feb2ed6bbed60663b306 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 22 Oct 2005 15:35:06 +0000 Subject: [PATCH] (get-buffer-window-list): Moved from subr.el. --- lisp/window.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/window.el b/lisp/window.el index a0820bb7cf6..48dd0f4b395 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -192,6 +192,18 @@ Anything else means restrict to the selected frame." (defalias 'some-window 'get-window-with-predicate) +;; This should probably be written in C (i.e., without using `walk-windows'). +(defun get-buffer-window-list (buffer &optional minibuf frame) + "Return list of all windows displaying BUFFER, or nil if none. +BUFFER can be a buffer or a buffer name. +See `walk-windows' for the meaning of MINIBUF and FRAME." + (let ((buffer (if (bufferp buffer) buffer (get-buffer buffer))) windows) + (walk-windows (function (lambda (window) + (if (eq (window-buffer window) buffer) + (setq windows (cons window windows))))) + minibuf frame) + windows)) + (defun minibuffer-window-active-p (window) "Return t if WINDOW (a minibuffer window) is now active." (eq window (active-minibuffer-window))) -- 2.39.5