changeset 14515:b35134a0e47a

Added get-buffer-window-list.
author Simon Marshall <simon@gnu.org>
date Thu, 08 Feb 1996 10:04:55 +0000
parents 2f15f316326d
children 9360c3107669
files lisp/subr.el
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Thu Feb 08 06:36:57 1996 +0000
+++ b/lisp/subr.el	Thu Feb 08 10:04:55 1996 +0000
@@ -697,6 +697,17 @@
 On those systems, it is automatically local in every buffer.
 On other systems, this variable is normally always nil.")
 
+;; This should probably be written in C (i.e., without using `walk-windows').
+(defun get-buffer-window-list (buffer &optional frame)
+  "Return windows currently displaying BUFFER, or nil if none.
+See `get-buffer-window' for the meaning of FRAME."
+  (let (windows)
+    (walk-windows (function (lambda (window)
+			      (if (eq (window-buffer window) buffer)
+				  (setq windows (cons window windows)))))
+		  nil frame)
+    windows))
+
 (defun ignore (&rest ignore)
   "Do nothing and return nil.
 This function accepts any number of arguments, but ignores them."