diff --git a/modules/lang/org/autoload/org-link.el b/modules/lang/org/autoload/org-link.el index fedfcad16..a1dc13eaa 100644 --- a/modules/lang/org/autoload/org-link.el +++ b/modules/lang/org/autoload/org-link.el @@ -74,8 +74,9 @@ exist, and `org-link' otherwise." ;;;###autoload (defun +org-http-image-data-fn (protocol link _description) "Interpret LINK as an URL to an image file." - (when (image-type-from-file-name link) - (if-let* ((buf (url-retrieve-synchronously (concat protocol ":" link)))) + (when (and (image-type-from-file-name link) + (not (eq org-display-remote-inline-images 'skip))) + (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) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 68e7bad5e..cb19b4001 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -413,7 +413,9 @@ relative to `org-directory', unless it is an absolute path." (+org-define-basic-link "doom-docs" 'doom-docs-dir) (+org-define-basic-link "doom-modules" 'doom-modules-dir) - ;; Allow inline image previews of http(s)? urls or data uris + ;; Allow inline image previews of http(s)? urls or data uris. + ;; `+org-http-image-data-fn' will respect `org-display-remote-inline-images'. + (setq org-display-remote-inline-images 'download) ; TRAMP urls (org-link-set-parameters "http" :image-data-fun #'+org-http-image-data-fn) (org-link-set-parameters "https" :image-data-fun #'+org-http-image-data-fn) (org-link-set-parameters "img" :image-data-fun #'+org-inline-image-data-fn)