[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org 402d2421d9 4/6: org-persist: Do not re-down
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org 402d2421d9 4/6: org-persist: Do not re-download url files on write |
Date: |
Wed, 14 Dec 2022 04:57:56 -0500 (EST) |
branch: externals-release/org
commit 402d2421d92be0a3c6b6960f1eb7c605e384ff53
Author: TEC <git@tecosaur.net>
Commit: Ihor Radchenko <yantar92@posteo.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 fe339505c5..30c5e17d48 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -662,12 +662,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 _)
- [elpa] externals-release/org updated (47bcdce19b -> 662e814bc0), ELPA Syncer, 2022/12/14
- [elpa] externals-release/org 88329143c8 2/6: org: Use buffer-base-buffer in safe resource fns, ELPA Syncer, 2022/12/14
- [elpa] externals-release/org 0db972ad63 1/6: ox: Handle failure to localize link, ELPA Syncer, 2022/12/14
- [elpa] externals-release/org fec15dedb9 5/6: test-ob-R.el: New function to test for :result output, ELPA Syncer, 2022/12/14
- [elpa] externals-release/org 662e814bc0 6/6: ob-R.el: Restore the handling of org-list in as var, ELPA Syncer, 2022/12/14
- [elpa] externals-release/org 6a126e40a7 3/6: org-persist: Ensure index instantiated before read, ELPA Syncer, 2022/12/14
- [elpa] externals-release/org 402d2421d9 4/6: org-persist: Do not re-download url files on write,
ELPA Syncer <=