org.el: org-toggle-inline-images: Only display messsages when interactive.

* lisp/org.el (org-toggle-inline-images): Only message if
called-interactively-p.

The old code made a halfhearted attempt to do this; this patch
provides the other half of the heart.
This commit is contained in:
Aaron Ecay 2015-01-19 00:16:51 -05:00
parent b3712b9840
commit 05ac7b37a4

View file

@ -19264,13 +19264,14 @@ INCLUDE-LINKED is passed to `org-display-inline-images'."
(if org-inline-image-overlays (if org-inline-image-overlays
(progn (progn
(org-remove-inline-images) (org-remove-inline-images)
(message "Inline image display turned off")) (when (org-called-interactively-p 'interactive)
(message "Inline image display turned off")))
(org-display-inline-images include-linked) (org-display-inline-images include-linked)
(if (and (org-called-interactively-p) (when (org-called-interactively-p 'interactive)
org-inline-image-overlays) (message (if org-inline-image-overlays
(message "%d images displayed inline" (format "%d images displayed inline"
(length org-inline-image-overlays)) (length org-inline-image-overlays))
(message "No images to display inline")))) "No images to display inline")))))
(defun org-redisplay-inline-images () (defun org-redisplay-inline-images ()
"Refresh the display of inline images." "Refresh the display of inline images."