From b53d38cfcd688467a7133d6077d62467946522ee Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 10 May 2017 16:10:53 +0200 Subject: Emacs: Configure desktop mode Auto-save Emacs' state if a desktop file exists. This is probably as DWIM as I need. --- emacs/.emacs.d/init.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 7cdf2090..96b3fe92 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -944,6 +944,27 @@ Workspaces, a bit like dwm. (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. -- cgit 1.4.1