From a3d79dcfa521a8d85fba645557446def304388ab Mon Sep 17 00:00:00 2001 From: Undead Kernel Date: Fri, 27 Sep 2019 14:03:11 +0200 Subject: [PATCH] doom/core: avoid the litter of session.* files When the x-window system commands emacs to quit, emacs saves a session in `.emacs.d/session.*` by default. There is no easy way to change the save path. This commit overwrites the function responsible for creating the session file name. We set the session file to reside in `doom-cache-dir`. --- core/core.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/core.el b/core/core.el index 7bbfae875..8a1b80dae 100644 --- a/core/core.el +++ b/core/core.el @@ -196,6 +196,13 @@ users).") url-cache-directory (concat doom-cache-dir "url/") url-configuration-directory (concat doom-etc-dir "url/") gamegrid-user-score-file-directory (concat doom-etc-dir "games/")) +;; HACK +(with-eval-after-load 'x-win + (defun emacs-session-filename (session-id) + "Construct a filename to save a session based on SESSION-ID. +Doom Emacs overrides this function to stop sessions from littering the user +directory. The session files are placed by default in `doom-cache-dir'" + (concat doom-cache-dir "emacs-session." session-id))) ;;