Optimize doom-visible-buffers
Walking the window list is almost always faster than walking the buffer list.
This commit is contained in:
parent
bdd9d91f72
commit
c109acd6fd
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue