Simplify and speed up update-buffer-list
This commit is contained in:
18
eyebrowse.el
18
eyebrowse.el
@ -333,20 +333,10 @@ If a buffer name equal to OLD is found, it is replaced with NEW."
|
|||||||
(defun update-buffer-list (new-list)
|
(defun update-buffer-list (new-list)
|
||||||
"Set buffers in NEW-LIST to be the most recently used, in order."
|
"Set buffers in NEW-LIST to be the most recently used, in order."
|
||||||
(when new-list
|
(when new-list
|
||||||
(let (firstbuf buf)
|
(dolist (b (reverse new-list))
|
||||||
(while new-list
|
(when (and (buffer-live-p b)
|
||||||
(setq buf (car new-list))
|
(not (minibufferp b)))
|
||||||
(when (stringp buf)
|
(switch-to-buffer b)))))
|
||||||
(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))))))
|
|
||||||
|
|
||||||
(defun eyebrowse--load-window-config (slot)
|
(defun eyebrowse--load-window-config (slot)
|
||||||
"Restore the window config from SLOT."
|
"Restore the window config from SLOT."
|
||||||
|
|||||||
Reference in New Issue
Block a user