Parcourir la source

org-persist-write: Overwrite existing copy if write is requested

Ihor Radchenko il y a 3 ans
Parent
commit
6a5874bb26
1 fichiers modifiés avec 2 ajouts et 4 suppressions
  1. 2 4
      lisp/org-persist.el

+ 2 - 4
lisp/org-persist.el

@@ -634,8 +634,7 @@ COLLECTION is the plist holding data collectin."
                          (format "%s-%s.%s" persist-file (md5 path) ext))))
                          (format "%s-%s.%s" persist-file (md5 path) ext))))
         (unless (file-exists-p (file-name-directory file-copy))
         (unless (file-exists-p (file-name-directory file-copy))
           (make-directory (file-name-directory file-copy) t))
           (make-directory (file-name-directory file-copy) t))
-        (unless (file-exists-p file-copy)
+        (copy-file path file-copy 'overwrite)
-          (copy-file path file-copy 'overwrite))
         (format "%s-%s.%s" persist-file (md5 path) ext)))))
         (format "%s-%s.%s" persist-file (md5 path) ext)))))
 
 
 (defun org-persist-write:url (c collection)
 (defun org-persist-write:url (c collection)
@@ -650,8 +649,7 @@ COLLECTION is the plist holding data collectin."
                          (format "%s-%s.%s" persist-file (md5 path) ext))))
                          (format "%s-%s.%s" persist-file (md5 path) ext))))
         (unless (file-exists-p (file-name-directory file-copy))
         (unless (file-exists-p (file-name-directory file-copy))
           (make-directory (file-name-directory file-copy) t))
           (make-directory (file-name-directory file-copy) t))
-        (unless (file-exists-p file-copy)
+        (url-copy-file path file-copy 'overwrite)
-          (url-copy-file path file-copy 'overwrite))
         (format "%s-%s.%s" persist-file (md5 path) ext)))))
         (format "%s-%s.%s" persist-file (md5 path) ext)))))
 
 
 (defun org-persist-write:index (container _)
 (defun org-persist-write:index (container _)