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

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

[elpa] externals/org 1a9d0850b6 10/10: org-persist: Do not re-download u


From: ELPA Syncer
Subject: [elpa] externals/org 1a9d0850b6 10/10: org-persist: Do not re-download url files on write
Date: Sun, 11 Dec 2022 02:57:58 -0500 (EST)

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

    org-persist: Do not re-download url files on write
    
    * lisp/org-persist.el (org-persist-write:url): Since the url write
    function is called as part of `org-persist-write-all', it is worth
    adding a check to avoid re-downloading the file if a file already exists
    in the expected location.
---
 lisp/org-persist.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index 5bdbbc0038..f215310a27 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -664,12 +664,13 @@ COLLECTION is the plist holding data collection."
              (file-copy (org-file-name-concat
                          org-persist-directory
                          (format "%s-%s.%s" persist-file (md5 path) ext))))
-        (unless (file-exists-p (file-name-directory file-copy))
-          (make-directory (file-name-directory file-copy) t))
-        (if (org--should-fetch-remote-resource-p path)
-            (url-copy-file path file-copy 'overwrite)
-          (error "The remote resource %S is considered unsafe, and will not be 
downloaded."
-                 path))
+        (unless (file-exists-p file-copy)
+          (unless (file-exists-p (file-name-directory file-copy))
+            (make-directory (file-name-directory file-copy) t))
+          (if (org--should-fetch-remote-resource-p path)
+              (url-copy-file path file-copy 'overwrite)
+            (error "The remote resource %S is considered unsafe, and will not 
be downloaded."
+                   path)))
         (format "%s-%s.%s" persist-file (md5 path) ext)))))
 
 (defun org-persist-write:index (container _)



reply via email to

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