fix(lib): don't kill buffers visible in another frame
For Doom's kill-current-buffer advice.
This commit is contained in:
parent
5718e4e96e
commit
a24ff58a5a
2 changed files with 7 additions and 3 deletions
|
@ -179,9 +179,13 @@ If DERIVED-P, test with `derived-mode-p', otherwise use `eq'."
|
|||
collect window))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-visible-buffers (&optional buffer-list)
|
||||
(defun doom-visible-buffers (&optional buffer-list all-frames)
|
||||
"Return a list of visible buffers (i.e. not buried)."
|
||||
(let ((buffers (delete-dups (mapcar #'window-buffer (window-list)))))
|
||||
(let ((buffers
|
||||
(delete-dups
|
||||
(cl-loop for frame in (if all-frames (visible-frame-list) (list (selected-frame)))
|
||||
if (window-list frame)
|
||||
nconc (mapcar #'window-buffer it)))))
|
||||
(if buffer-list
|
||||
(cl-delete-if (lambda (b) (memq b buffer-list))
|
||||
buffers)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue