commit 7e3af7a8586a33fae01dff976c2a22725fe53af9 parent 9058b8fea2ce62a5c6bc87f151a9bda6b1000982 Author: Oleh Krehel <ohwoeowho@gmail.com> Date: Tue, 4 Jun 2019 14:53:54 +0200 org-download.el (org-download-display-inline-images): Extend Re #103 Diffstat:
| M | org-download.el | | | 36 | +++++++++++++++++++++--------------- |
1 file changed, 21 insertions(+), 15 deletions(-)
diff --git a/org-download.el b/org-download.el @@ -175,7 +175,11 @@ For example: (defcustom org-download-display-inline-images t "When non-nil display inline images in org buffer after download." - :type 'boolean) + :type + '(choice + (const :tag "On" t) + (const :tag "Off" nil) + (const :tag "Posframe" posframe))) (defvar org-download-posframe-show-params '(;; Please do not remove :timeout or set it to large. @@ -208,20 +212,22 @@ For example: (copy-file image-file thumbnail-file t)))) (defun org-download--display-inline-images () - (if org-download-display-inline-images - (org-display-inline-images) - (require 'posframe) - (when (posframe-workable-p) - (let ((buffer (get-buffer-create " *org-download-image"))) - (funcall org-download-thumbnail-function - org-download-path-last-file - org-download-thumbnail-file) - (with-current-buffer buffer - (erase-buffer) - (insert-image-file org-download-thumbnail-file)) - (apply #'posframe-show - buffer - org-download-posframe-show-params))))) + (cond + ((eq org-download-display-inline-images t) + (org-display-inline-images)) + ((eq org-download-display-inline-images 'posframe) + (require 'posframe) + (when (posframe-workable-p) + (let ((buffer (get-buffer-create " *org-download-image"))) + (funcall org-download-thumbnail-function + org-download-path-last-file + org-download-thumbnail-file) + (with-current-buffer buffer + (erase-buffer) + (insert-image-file org-download-thumbnail-file)) + (apply #'posframe-show + buffer + org-download-posframe-show-params)))))) (defun org-download-get-heading (lvl) "Return the heading of the current entry's LVL level parent."