emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 876e813: org-persist.el: Fix Emacs versions where x


From: ELPA Syncer
Subject: [elpa] externals/org 876e813: org-persist.el: Fix Emacs versions where xdg.el is not available
Date: Tue, 9 Nov 2021 20:57:29 -0500 (EST)

branch: externals/org
commit 876e8133343cccff32ac1cd17d06ff957715e8f1
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-persist.el: Fix Emacs versions where xdg.el is not available
    
    * lisp/org-persist.el (org-persist-directory): Make `xdg-cache-home'
    call optional.  Prefer cache directory in `user-emacs-directory' when
    the cache already exists there.
    
    Fixes 
https://list.orgmode.org/CAFqubHf+WpuNEEapKcG94WjHFcRxVSF+j-7Ut3b_roMfKQchhg@mail.gmail.com/T/#m99c63439a745c07fd7c30cde0b49b3d5bd1757f0
---
 lisp/org-persist.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index a54276c..e97648b 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -29,7 +29,7 @@
 
 (require 'org-compat)
 (require 'org-id)
-(require 'xdg)
+(require 'xdg nil t)
 
 (declare-function org-back-to-heading "org" (&optional invisible-ok))
 (declare-function org-next-visible-heading "org" (arg))
@@ -37,9 +37,13 @@
 
 (defvar org-persist-directory (expand-file-name
                     (org-file-name-concat
-                     (let ((cache-dir (xdg-cache-home)))
+                     (let ((cache-dir (when (fboundp 'xdg-cache-home)
+                                        (xdg-cache-home))))
                        (if (or (seq-empty-p cache-dir)
-                               (not (file-exists-p cache-dir)))
+                               (not (file-exists-p cache-dir))
+                               (file-exists-p (org-file-name-concat
+                                               user-emacs-directory
+                                               "org-persist")))
                            user-emacs-directory
                          cache-dir))
                      "org-persist/"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]