Commit cf20330b authored by Martin Rudalics's avatar Martin Rudalics

(get-buffer-window-list): Rename buffer argument to

buffer-or-name and make it optional.
parent fec89261
2008-10-25 Martin Rudalics <rudalics@gmx.at>
* window.el (get-buffer-window-list): Rename buffer argument to
buffer-or-name and make it optional.
2008-10-25 Juanma Barranquero <lekktu@gmail.com>
* completion.el (add-completion-to-head, add-completion): Doc fixes.
......
......@@ -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)))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment