Function: markdown--dnd-local-file-handler

markdown--dnd-local-file-handler is a byte-compiled function defined in markdown-mode.el.

Signature

(markdown--dnd-local-file-handler URL ACTION)

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown--dnd-local-file-handler (url action)
  (require 'mailcap)
  (require 'dnd)
  (let* ((filename (dnd-get-local-file-name url))
         (method (if (eq markdown-yank-dnd-method 'ask)
                     (markdown--dnd-read-method)
                   markdown-yank-dnd-method)))
    (cl-case method
      (copy-and-insert
       (let ((copied (expand-file-name (file-name-nondirectory filename))))
         (copy-file filename copied)
         (markdown--dnd-insert-path (file-relative-name copied))))
      (open
       (dnd-open-local-file url action))
      (insert (markdown--dnd-insert-path (file-relative-name filename))))))