mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Use org-download-dnd instead of inhouse dnd handler
Possibly fixes #3056
This commit is contained in:
@ -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
|
||||
;; HACK We add these manually so that org-download is truly lazy-loaded
|
||||
(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))
|
||||
(advice-add #'org-download-enable :override #'ignore)
|
||||
|
||||
|
Reference in New Issue
Block a user