desktop-save-mode in order to restore buffers on startup. However, the buffer which is visible immediately after startup is
.bbdb, etc. I am not interested in those. Is there a way to have Emacs after a restart in the same buffer state, including ordering, as when it was closed?
I have the following in my equivalent of a .emacs file:
(defun my-bury-star-buffers () "Bury all star buffers." (interactive) (mapc (lambda (buf) (when (string-match-p "\\`\\*.*\\*\\'" (buffer-name buf)) (bury-buffer buf))) (buffer-list))) (add-hook 'desktop-after-read-hook #'my-bury-star-buffers)
I don't remember where I got it. You'll need to extend the regex for any other files you want buried (like .bbdb). The non-buried buffers seem to be in the right order.