Use org-download-dnd instead of inhouse dnd handler

Possibly fixes #3056
This commit is contained in:
Henrik Lissner 2020-05-07 15:59:26 -04:00
parent 0f696ec8b3
commit 47571446b9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 1 additions and 13 deletions

View file

@ -1,12 +0,0 @@
;;; lang/org/autoload/contrib-dragndrop.el -*- lexical-binding: t; -*-
;;;###if (featurep! +dragndrop)
;;;###autoload
(defun +org-dragndrop-download-dnd-fn (uri action)
"Handle file links and base64 data uris."
(if (eq major-mode 'org-mode)
(+org/attach-file-and-insert-link uri)
(let ((dnd-protocol-alist
(rassq-delete-all '+org-dragndrop-download-dnd-fn
(copy-alist dnd-protocol-alist))))
(dnd-handle-one-url nil action uri))))

View file

@ -10,7 +10,7 @@
:init :init
;; HACK We add these manually so that org-download is truly lazy-loaded ;; HACK We add these manually so that org-download is truly lazy-loaded
(pushnew! dnd-protocol-alist (pushnew! dnd-protocol-alist
'("^\\(?:https?\\|ftp\\|file\\|nfs\\):" . +org-dragndrop-download-dnd-fn) '("^\\(?:https?\\|ftp\\|file\\|nfs\\):" . org-download-dnd)
'("^data:" . org-download-dnd-base64)) '("^data:" . org-download-dnd-base64))
(advice-add #'org-download-enable :override #'ignore) (advice-add #'org-download-enable :override #'ignore)