diff --git a/eyebrowse.el b/eyebrowse.el index 25908c4..8f03c98 100644 --- a/eyebrowse.el +++ b/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) "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."