org-download

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

commit 14ea3a8f02cc2070221bada4e34491886de39a26
parent 2fb3f5077dac71c859f011d2ebbc7bf058e47bb0
Author: Oleh Krehel <ohwoeowho@gmail.com>
Date:   Fri, 18 Oct 2013 10:11:30 +0200

org-download.el: added enable/disable functions

* org-download.el (org-download-enable): new function.
  (org-download-disable): new function.

Diffstat:
Morg-download.el | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/org-download.el b/org-download.el @@ -74,10 +74,18 @@ DIR is the name of the current level 0 heading." filename)) (org-display-inline-images)))) -(setcdr (assoc "^\\(https?\\|ftp\\|file\\|nfs\\)://" dnd-protocol-alist) 'org-download-dnd) - (defun org-download-dnd (uri action) (org-download-image uri)) +(defun org-download-enable () + (unless (eq (cdr (assoc "^\\(https?\\|ftp\\|file\\|nfs\\)://" dnd-protocol-alist)) + 'org-download-dnd) + (setq dnd-protocol-alist + `(("^\\(https?\\|ftp\\|file\\|nfs\\)://" . org-download-dnd) ,@dnd-protocol-alist)))) + +(defun org-download-disable () + (rassq-delete-all 'org-download-dnd dnd-protocol-alist)) + +(org-download-enable) (provide 'org-download) ;;; org-download.el ends here