Skip to content

Commit

Permalink
Fix byte-compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
syohex committed Oct 27, 2023
1 parent e10e5af commit d419a1c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@

(declare-function project-roots "project")
(declare-function sh-set-shell "sh-script")
(declare-function mailcap-file-name-to-mime-type "mailcap")
(declare-function dnd-get-local-file-name "dnd")

;; for older emacs<29
(declare-function mailcap-mime-type-to-extension "mailcap")
Expand Down Expand Up @@ -9872,11 +9874,16 @@ rows and columns and the column alignment."

(defun markdown--dnd-local-file-handler (url _action)
(require 'mailcap)
(require 'dnd)
(let* ((filename (dnd-get-local-file-name url))
(file (file-relative-name filename)))
(mimetype (mailcap-file-name-to-mime-type filename))
(file (file-relative-name filename))
(link-text "link text"))
(when (string-match-p "\\s-" file)
(setq file (concat "<" file ">")))
(markdown-insert-inline-image "link text" file)))
(if (string-prefix-p "image/" mimetype)
(markdown-insert-inline-image link-text file)
(markdown-insert-inline-link link-text file))))


;;; Mode Definition ==========================================================
Expand Down

0 comments on commit d419a1c

Please sign in to comment.