diff --git a/lisp/org-persist.el b/lisp/org-persist.el index 60291e518..0d4f42583 100644 --- a/lisp/org-persist.el +++ b/lisp/org-persist.el @@ -650,9 +650,10 @@ 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)) - (copy-file path file-copy 'overwrite) + (unless (file-exists-p file-copy) + (unless (file-exists-p (file-name-directory file-copy)) + (make-directory (file-name-directory file-copy) t)) + (copy-file path file-copy 'overwrite)) (format "%s-%s.%s" persist-file (md5 path) ext))))) (defun org-persist-write:url (c collection)