org-download

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

commit 06e39cb93b18676c62d175a834d382cb47a64268
parent 115433394221da8071dedf7e3f056e37f097a272
Author: Oleh Krehel <ohwoeowho@gmail.com>
Date:   Sat, 19 Nov 2016 12:12:47 +0100

org-download.el (org-download-insert-link): Split off

Diffstat:
Morg-download.el | 29++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/org-download.el b/org-download.el @@ -308,19 +308,22 @@ It's inserted before the image link and is used to annotate it.") (org-download--image link filename) (when (eq org-download-method 'attach) (org-attach-attach filename nil 'none)) - (if (looking-back "^[ \t]+" (line-beginning-position)) - (delete-region (match-beginning 0) (match-end 0)) - (newline)) - (insert - (concat - (funcall org-download-annotate-function link) - (format "\n%s[[file:%s]]" - (if (= org-download-image-width 0) - "" - (format - "#+attr_html: :width %dpx\n" org-download-image-width)) - (file-relative-name filename (file-name-directory (buffer-name)))))) - (org-display-inline-images))))) + (org-download-insert-link link filename))))) + +(defun org-download-insert-link (link filename) + (if (looking-back "^[ \t]+" (line-beginning-position)) + (delete-region (match-beginning 0) (match-end 0)) + (newline)) + (insert + (concat + (funcall org-download-annotate-function link) + (format "\n%s[[file:%s]]" + (if (= org-download-image-width 0) + "" + (format + "#+attr_html: :width %dpx\n" org-download-image-width)) + (file-relative-name filename (file-name-directory (buffer-name)))))) + (org-display-inline-images)) (defun org-download--at-comment-p () "Check if current line begins with #+DOWLOADED:."