Start actually caching ltximg, and move general temp dir to $XDG_RUNTIME_DIR
This commit is contained in:
parent
8f0da429f6
commit
b1010e4df6
25
init.el
25
init.el
|
@ -19,17 +19,21 @@
|
||||||
use-package-expand-minimally t)
|
use-package-expand-minimally t)
|
||||||
(require 'use-package)
|
(require 'use-package)
|
||||||
|
|
||||||
(let ((emacs-tmp-dir (expand-file-name (format "emacs%d" (user-uid))
|
(require 'xdg)
|
||||||
temporary-file-directory)))
|
(defvar my-tmp-dir (if-let* ((runtime-dir (xdg-runtime-dir)))
|
||||||
(setq auto-save-file-name-transforms `((".*" ,emacs-tmp-dir t))
|
(expand-file-name "emacs/"
|
||||||
auto-save-list-file-prefix emacs-tmp-dir
|
runtime-dir)
|
||||||
backup-directory-alist (setq undo-tree-history-directory-alist
|
(expand-file-name (format "emacs%d/"
|
||||||
`((".*" . ,emacs-tmp-dir)))
|
(user-uid))
|
||||||
org-preview-latex-image-directory (expand-file-name "ltximg" emacs-tmp-dir)))
|
temporary-file-directory))
|
||||||
|
"Directory used to store temporary state.")
|
||||||
|
|
||||||
(setq backup-by-copying t
|
(setq auto-save-file-name-transforms `((".*" ,my-tmp-dir t))
|
||||||
|
auto-save-list-file-prefix my-tmp-dir
|
||||||
|
backup-directory-alist `((".*" . ,my-tmp-dir))
|
||||||
|
backup-by-copying t
|
||||||
inhibit-splash-screen t
|
inhibit-splash-screen t
|
||||||
custom-file (expand-file-name "custom.el" temporary-file-directory)
|
custom-file (expand-file-name "custom.el" my-tmp-dir)
|
||||||
custom-safe-themes t)
|
custom-safe-themes t)
|
||||||
|
|
||||||
(defun my-inhibit-hl-line-mode ()
|
(defun my-inhibit-hl-line-mode ()
|
||||||
|
@ -539,6 +543,9 @@
|
||||||
;; NixOS minimal LaTeX setup
|
;; NixOS minimal LaTeX setup
|
||||||
(org-latex-compiler "lualatex")
|
(org-latex-compiler "lualatex")
|
||||||
(org-preview-latex-default-process 'lua-dvisvgm)
|
(org-preview-latex-default-process 'lua-dvisvgm)
|
||||||
|
(org-preview-latex-image-directory (if-let* ((cache (xdg-cache-home)))
|
||||||
|
(expand-file-name "ltximg/" cache)
|
||||||
|
".ltximg/"))
|
||||||
(org-latex-src-block-backend 'engraved)
|
(org-latex-src-block-backend 'engraved)
|
||||||
:config
|
:config
|
||||||
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.3)
|
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.3)
|
||||||
|
|
Loading…
Reference in a new issue