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
1 changed files with 7 additions and 6 deletions

View File

@ -19264,13 +19264,14 @@ INCLUDE-LINKED is passed to `org-display-inline-images'."
(if org-inline-image-overlays
(progn
(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)
(if (and (org-called-interactively-p)
org-inline-image-overlays)
(message "%d images displayed inline"
(length org-inline-image-overlays))
(message "No images to display inline"))))
(when (org-called-interactively-p 'interactive)
(message (if org-inline-image-overlays
(format "%d images displayed inline"
(length org-inline-image-overlays))
"No images to display inline")))))
(defun org-redisplay-inline-images ()
"Refresh the display of inline images."