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

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

[elpa] externals/org e663b90fe5 05/10: org-persist: Fix unconditional gc


From: ELPA Syncer
Subject: [elpa] externals/org e663b90fe5 05/10: org-persist: Fix unconditional gc of urls
Date: Sun, 11 Dec 2022 02:57:58 -0500 (EST)

branch: externals/org
commit e663b90fe58412397761565b82b730b2a43f6449
Author: TEC <git@tecosaur.net>
Commit: TEC <git@tecosaur.net>

    org-persist: Fix unconditional gc of urls
    
    * lisp/org-persist.el (org-persist-gc): The :file association of URL
    containers lead to `file-exists-p' being called on them, which always
    returns nil, causing URL containers to always be garbage collected.
    Since the :file entry doesn't really represent a filesystem object, we
    now check if the container is url and if so prevent the :file
    association from being used in gc checks.
---
 lisp/org-persist.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index f53eb53ec5..c7536bcee7 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -944,6 +944,7 @@ Also, remove containers associated with non-existing files."
                    (directory-files-recursively org-persist-directory ".+"))))
       (dolist (collection org-persist--index)
         (let* ((file (plist-get (plist-get collection :associated) :file))
+               (web-file (and file (string-match-p "\\`https?://" file)))
                (file-remote (when file (file-remote-p file)))
                (persist-file (when (plist-get collection :persist-file)
                                (org-file-name-concat
@@ -953,7 +954,7 @@ Also, remove containers associated with non-existing files."
                           (plist-get collection :expiry) collection)))
           (when persist-file
             (setq orphan-files (delete persist-file orphan-files))
-            (when file
+            (when (and file (not web-file))
               (when file-remote (cl-incf remote-files-num))
               (unless (if (not file-remote)
                           (file-exists-p file)



reply via email to

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