General refactors & reformatting across the board

This commit is contained in:
Henrik Lissner 2020-05-15 01:44:53 -04:00
parent 4e28b48a3a
commit ea18c83c0a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
19 changed files with 123 additions and 110 deletions

View file

@ -46,11 +46,15 @@ exist, and `org-link' otherwise."
"Intepret LINK as an image file path and return its data."
(setq
link (expand-file-name
link
(pcase protocol
("download" (or org-download-image-dir org-attach-id-dir default-directory))
("attachment" org-attach-id-dir)
(_ default-directory))))
link (pcase protocol
("download"
(or (if (require 'org-download nil t) org-download-image-dir)
(if (require 'org-attach) org-attach-id-dir)
default-directory))
("attachment"
(require 'org-attach)
org-attach-id-dir)
(_ default-directory))))
(when (and (file-exists-p link)
(image-type-from-file-name link))
(with-temp-buffer