Simplify and speed up update-buffer-list

This commit is contained in:
2025-04-22 13:55:27 -10:00
parent 2034ec7a44
commit adacbd6e9a

View File

@ -333,20 +333,10 @@ If a buffer name equal to OLD is found, it is replaced with NEW."
(defun update-buffer-list (new-list)
"Set buffers in NEW-LIST to be the most recently used, in order."
(when new-list
(let (firstbuf buf)
(while new-list
(setq buf (car new-list))
(when (stringp buf)
(setq buf (get-buffer buf)))
(when (buffer-live-p buf)
(bury-buffer buf)
(unless firstbuf
(setq firstbuf buf)))
(setq new-list (cdr new-list)))
(setq new-list (buffer-list))
(while (not (eq (car new-list) firstbuf))
(bury-buffer (car new-list))
(setq new-list (cdr new-list))))))
(dolist (b (reverse new-list))
(when (and (buffer-live-p b)
(not (minibufferp b)))
(switch-to-buffer b)))))
(defun eyebrowse--load-window-config (slot)
"Restore the window config from SLOT."