org-download

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

commit 704da2a6047ea7634fef472321eb255509471107
parent 0c79928c6ac83072b0ca13b0811b0e763cdca0ef
Author: Oleh Krehel <ohwoeowho@gmail.com>
Date:   Fri, 18 Oct 2013 11:11:17 +0200

org-download.el: added `org-download-delete'

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

diff --git a/org-download.el b/org-download.el @@ -126,6 +126,19 @@ DIR is the name of the current level 0 heading." filename)) (org-display-inline-images)))) +(defun org-download-delete () + "Delete inline image link on current line, and the file that it points to." + (interactive) + (save-excursion + (beginning-of-line) + (if (looking-at ".*?\\[\\[\\([^]]*\\)\\]\\]") + (progn + (let ((str (match-string-no-properties 1))) + (delete-region (match-beginning 0) + (match-end 0)) + (when (file-exists-p str) + (delete-file str))))))) + (defun org-download-dnd (uri action) (org-download-image uri))