From: Martin Rudalics Date: Sat, 25 Oct 2008 08:08:19 +0000 (+0000) Subject: (get-buffer-window-list): Rename buffer argument to X-Git-Tag: emacs-pretest-23.0.90~2192 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cf20330bba87d1f2bb622d2403fcce4c9830dfee;p=emacs.git (get-buffer-window-list): Rename buffer argument to buffer-or-name and make it optional. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5c5816a6ec6..56d04af23e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-10-25 Martin Rudalics + + * window.el (get-buffer-window-list): Rename buffer argument to + buffer-or-name and make it optional. + 2008-10-25 Juanma Barranquero * 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." (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)))))