Explorar o código

Use XDG cache dir as default dir for cache persistance

* lisp/org-persist.el (org-persist-path): Change default dir to XDG
cache dir and fall back to `user-emacs-directory' as the last resort.
Ihor Radchenko %!s(int64=3) %!d(string=hai) anos
pai
achega
eeb04504ef
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      lisp/org-persist.el

+ 7 - 1
lisp/org-persist.el

@@ -29,12 +29,18 @@
 
 (require 'org-compat)
 (require 'org-id)
+(require 'xdg)
 
 (declare-function org-back-to-heading "org" (&optional invisible-ok))
 (declare-function org-next-visible-heading "org" (arg))
 (declare-function org-at-heading-p "org" (&optional invisible-not-ok))
 
-(defvar org-persist-path (org-file-name-concat user-emacs-directory "org-persist/")
+(defvar org-persist-path (org-file-name-concat
+               (let ((cache-dir (xdg-cache-home)))
+                 (if (seq-empty-p cache-dir)
+                     user-emacs-directory
+                   cache-dir))
+               "org-persist/")
   "Directory where the data is stored.")
 
 (defvar org-persist-index-file "index"