diff options
Diffstat (limited to 'lisp/window.el')
| -rw-r--r-- | lisp/window.el | 13 |
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." | |||
| 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. |
| 198 | BUFFER can be a buffer or a buffer name. | 198 | BUFFER-OR-NAME may be a buffer or the name of an existing buffer |
| 199 | and defaults to nil. | ||
| 199 | See `walk-windows' for the meaning of MINIBUF and ALL-FRAMES." | 200 | See `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))))) |