fix: ensure auto-save file directory exists

Also don't create a tramp sub-directory, so we don't have to ensure two
directories.

Amend: 12e6027bda
This commit is contained in:
Henrik Lissner 2025-12-23 18:27:32 -05:00
parent bb9762bd03
commit 043000f2ca
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -117,9 +117,14 @@ possible."
;; transform is better:
auto-save-file-name-transforms
`(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'"
,(file-name-concat auto-save-list-file-prefix "tramp" "\\2-") sha1)
,(file-name-concat auto-save-list-file-prefix "tramp-\\2-") sha1)
("\\([^/]+\\)\\'" ,(file-name-concat auto-save-list-file-prefix "\\1-") sha1)))
(add-hook! 'auto-save-hook
(defun doom-ensure-auto-save-prefix-exists-h ()
(with-file-modes #o700
(make-directory auto-save-list-file-prefix t))))
(add-hook! 'after-save-hook
(defun doom-guess-mode-h ()
"Guess major mode when saving a file in `fundamental-mode'.