summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2008-10-25 08:08:19 +0000
committerMartin Rudalics <rudalics@gmx.at>2008-10-25 08:08:19 +0000
commitcf20330bba87d1f2bb622d2403fcce4c9830dfee (patch)
tree63085c95c3506a966c2c354195896e124a8f233c /lisp/window.el
parentfec89261155d2e57ec33a27bd87d8f7d0ee5135b (diff)
downloademacs-cf20330bba87d1f2bb622d2403fcce4c9830dfee.tar.gz
(get-buffer-window-list): Rename buffer argument to
buffer-or-name and make it optional.
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 0c1288be90b..c9e5d793651 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -193,11 +193,16 @@ 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 all-frames)
- "Return list of all windows displaying BUFFER, or nil if none.
-BUFFER can be a buffer or a buffer name.
+(defun get-buffer-window-list (&optional buffer-or-name minibuf all-frames)
+ "Return list of all windows displaying BUFFER-OR-NAME, or nil if none.
+BUFFER-OR-NAME may be a buffer or the name of an existing buffer
+and defaults to nil.
See `walk-windows' for the meaning of MINIBUF and ALL-FRAMES."
- (let ((buffer (if (bufferp buffer) buffer (get-buffer buffer))) windows)
+ (let ((buffer (cond
+ ((not buffer-or-name) (current-buffer))
+ ((bufferp buffer-or-name) buffer-or-name)
+ (t (get-buffer buffer-or-name))))
+ windows)
(walk-windows (function (lambda (window)
(if (eq (window-buffer window) buffer)
(setq windows (cons window windows)))))