diff options
Diffstat (limited to 'desktop-conf.el')
-rw-r--r-- | desktop-conf.el | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/desktop-conf.el b/desktop-conf.el index 4762f42..7478742 100644 --- a/desktop-conf.el +++ b/desktop-conf.el @@ -1,3 +1,31 @@ +;;; desktop-conf.el --- Configure desktop mode -*- lexical-binding: t; -*- + +;; Copyright (C) 2022 Jean Sévère Durand + +;; Author: Jean Sévère Durand <durand@jsdurand.xyz> +;; Keywords: data, files, internal, maint + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Configure the desktop-mode, which saves caches of Emacs states. + +;;; Code: + +;;; Basic settings + (setq desktop-auto-save-timeout 600) (setq desktop-dirname "/Users/durand/.emacs.d/") (setq desktop-path '("/Users/durand/.emacs.d/")) @@ -10,7 +38,13 @@ (setq desktop-restore-frames nil) (setq desktop-save 'ask-if-new) -;;;###autoload +;;; Also save bookmarks before + +(add-hook 'desktop-save-hook #'bookmark-save) + +;;; Overwrite the saving function + +;; Modify to hard-code the directory to save the desktop file. (defun durand-desktop-save-a (dirname &optional release only-if-changed version) "Save the state of Emacs in a desktop file in directory DIRNAME. Optional argument RELEASE non-nil says we're done with this @@ -32,7 +66,7 @@ file. To upgrade a version 206 file to version 208, call this command explicitly with a prefix argument: \\[universal-argument] \\[desktop-save]. -If you are upgrading from Emacs 24 or older, we recommed to do +If you are upgrading from Emacs 24 or older, we recommend to do this once you decide you no longer need compatibility with versions of Emacs before 25.1. @@ -166,5 +200,10 @@ no questions asked." (advice-add 'desktop-save :override 'durand-desktop-save-a) +;;; Enable the mode (desktop-save-mode 1) + + +(provide 'desktop-conf) +;;; desktop-conf.el ends here |