mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Optimize doom-visible-buffers
Walking the window list is almost always faster than walking the buffer list.
This commit is contained in:
@ -177,9 +177,9 @@ If DERIVED-P, test with `derived-mode-p', otherwise use `eq'."
|
||||
;;;###autoload
|
||||
(defun doom-visible-buffers (&optional buffer-list)
|
||||
"Return a list of visible buffers (i.e. not buried)."
|
||||
(cl-loop for buf in (or buffer-list (doom-buffer-list))
|
||||
when (get-buffer-window buf)
|
||||
collect buf))
|
||||
(if buffer-list
|
||||
(cl-remove-if-not #'get-buffer-window buffer-list)
|
||||
(delete-dups (mapcar #'window-buffer (window-list)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-buried-buffers (&optional buffer-list)
|
||||
|
Reference in New Issue
Block a user