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`.
This commit is contained in:
Undead Kernel 2019-09-27 14:03:11 +02:00
parent 4a8cef56ea
commit a3d79dcfa5

View file

@ -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)))
;;