# HG changeset patch # User Martin Rudalics # Date 1224922062 0 # Node ID 6fff8b7a31ca160c13b06c881cce06af26964fa7 # Parent cb50c1c2666bece4ed005c482ca0b77828b2dce9 (get-buffer-window-list): Rename buffer argument to buffer-or-name and make it optional. diff -r cb50c1c2666b -r 6fff8b7a31ca lisp/window.el --- a/lisp/window.el Sat Oct 25 07:57:37 2008 +0000 +++ b/lisp/window.el Sat Oct 25 08:07:42 2008 +0000 @@ -193,11 +193,16 @@ (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)))))