Refactor lang/org
This commit is contained in:
parent
c0c4b897ea
commit
fa26dc1269
7 changed files with 253 additions and 271 deletions
|
@ -13,3 +13,20 @@
|
|||
(format "%s:%s"
|
||||
key
|
||||
(file-relative-name file dir))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-inline-data-image (_protocol link _description)
|
||||
"Interpret LINK as base64-encoded image data."
|
||||
(base64-decode-string link))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-image-link (protocol link _description)
|
||||
"Interpret LINK as base64-encoded image data."
|
||||
(when (image-type-from-file-name link)
|
||||
(if-let* ((buf (url-retrieve-synchronously (concat protocol ":" link))))
|
||||
(with-current-buffer buf
|
||||
(goto-char (point-min))
|
||||
(re-search-forward "\r?\n\r?\n" nil t)
|
||||
(buffer-substring-no-properties (point) (point-max)))
|
||||
(message "Download of image \"%s\" failed" link)
|
||||
nil)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue