Emacs: Configure desktop mode Auto-save Emacs' state if a desktop file exists. This is probably as DWIM as I need.
Alan Pearce alan@alanpearce.eu
Wed, 10 May 2017 16:10:53 +0200
1 files changed, 21 insertions(+), 0 deletions(-)
jump to
M emacs/.emacs.d/init.org → emacs/.emacs.d/init.org
@@ -944,6 +944,27 @@ (setq eyebrowse-new-workspace t) (eyebrowse-mode +1))) #+END_SRC +* Sessions + +** Desktop +Save my Emacs session and restore it on startup. + +#+BEGIN_SRC emacs-lisp +(use-package desktop + :ensure nil + :config (progn + (setq desktop-dirname (expand-file-name "desktop/" user-emacs-directory) + desktop-base-file-name "emacs.desktop" + desktop-base-lock-name "lock" + desktop-path (list desktop-dirname) + desktop-save 'if-exists + desktop-files-not-to-save "^$" + desktop-load-locked-desktop nil) + (unless (file-directory-p desktop-dirname) + (make-directory desktop-dirname)) + (desktop-save-mode 1))) +#+END_SRC + ** winner Undo, for window-based commands.