Use org-download-dnd instead of inhouse dnd handler
Possibly fixes #3056
This commit is contained in:
parent
0f696ec8b3
commit
47571446b9
2 changed files with 1 additions and 13 deletions
|
@ -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))))
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue