I would like to keep distinct desktop files in order to be able resume sessions based on the mode.
When I open Emacs it should load the desktop file for the mode it starts with and when I run, say,
M-x latex-mode it should load (and later overwrite) another desktop file. In my noobness I had hoped a
(setq desktop-path '("~/.emacs.d/desktops/plain" ~/.emacs.d/desktops/latex-mode")) (defun my-TeX-hook () (desktop-change-dir "~/.emacs.d/desktops/latex-mode")) (add-hook 'TeX-mode-hook 'my-TeX-hook)
.emacs would work, but it didn't.