-(defun bs--window-for-buffer (buffer-name)
- "Return a window showing a buffer with name BUFFER-NAME.
-Take only windows of current frame into account.
-Return nil if there is no such buffer."
- (catch 'window
- (walk-windows (lambda (w)
- (when (string= (buffer-name (window-buffer w))
- buffer-name)
- (throw 'window w))))
- nil))
-