aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMartin Rudalics2008-10-25 08:08:19 +0000
committerMartin Rudalics2008-10-25 08:08:19 +0000
commitcf20330bba87d1f2bb622d2403fcce4c9830dfee (patch)
tree63085c95c3506a966c2c354195896e124a8f233c /lisp
parentfec89261155d2e57ec33a27bd87d8f7d0ee5135b (diff)
downloademacs-cf20330bba87d1f2bb622d2403fcce4c9830dfee.tar.gz
emacs-cf20330bba87d1f2bb622d2403fcce4c9830dfee.zip
(get-buffer-window-list): Rename buffer argument to
buffer-or-name and make it optional.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/window.el13
2 files changed, 14 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5c5816a6ec6..56d04af23e7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-10-25 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (get-buffer-window-list): Rename buffer argument to
4 buffer-or-name and make it optional.
5
12008-10-25 Juanma Barranquero <lekktu@gmail.com> 62008-10-25 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * completion.el (add-completion-to-head, add-completion): Doc fixes. 8 * completion.el (add-completion-to-head, add-completion): Doc fixes.
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."
193(defalias 'some-window 'get-window-with-predicate) 193(defalias 'some-window 'get-window-with-predicate)
194 194
195;; This should probably be written in C (i.e., without using `walk-windows'). 195;; This should probably be written in C (i.e., without using `walk-windows').
196(defun get-buffer-window-list (buffer &optional minibuf all-frames) 196(defun get-buffer-window-list (&optional buffer-or-name minibuf all-frames)
197 "Return list of all windows displaying BUFFER, or nil if none. 197 "Return list of all windows displaying BUFFER-OR-NAME, or nil if none.
198BUFFER can be a buffer or a buffer name. 198BUFFER-OR-NAME may be a buffer or the name of an existing buffer
199and defaults to nil.
199See `walk-windows' for the meaning of MINIBUF and ALL-FRAMES." 200See `walk-windows' for the meaning of MINIBUF and ALL-FRAMES."
200 (let ((buffer (if (bufferp buffer) buffer (get-buffer buffer))) windows) 201 (let ((buffer (cond
202 ((not buffer-or-name) (current-buffer))
203 ((bufferp buffer-or-name) buffer-or-name)
204 (t (get-buffer buffer-or-name))))
205 windows)
201 (walk-windows (function (lambda (window) 206 (walk-windows (function (lambda (window)
202 (if (eq (window-buffer window) buffer) 207 (if (eq (window-buffer window) buffer)
203 (setq windows (cons window windows))))) 208 (setq windows (cons window windows)))))