org-download

a fork of abo-abo's org-download
git clone https://git.trogloxene.org/org-download.git
Log | Files | Refs | README

commit 50988b94d6996f6102d3d420fd33882a8c8cdb16
parent 1a9d786a48164895ea4ab69357e51a4dab4d7310
Author: Oleh Krehel <ohwoeowho@gmail.com>
Date:   Thu, 31 Oct 2013 13:41:42 +0100

org-download.el (org-download--image): small improvement.

Diffstat:
Morg-download.el | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/org-download.el b/org-download.el @@ -138,12 +138,12 @@ It's affected by `org-download-timestamp' and `org-download--dir'." (defun org-download--image (link filename) "Save LINK to FILENAME asynchronously and show inline images in current buffer." - (cond ((string-match "^file://\\(.*\\)" link) + (when (string-match "^file://\\(.*\\)" link) + (setq link (url-unhex-string (match-string 1 link)))) + (cond ((file-exists-p link) (org-download--image/command "cp \"%s\" \"%s\"" - (url-unhex-string - (match-string 1 link)) - filename)) + link filename)) ((eq org-download-backend t) (org-download--image/url-retrieve link filename)) (t (org-download--image/command org-download-backend link filename))))