From 621396f4b5c46f109aaec5afcb0a983153d8a60a Mon Sep 17 00:00:00 2001 From: Karthik Chikmagalur Date: Fri, 27 Dec 2024 19:45:01 -0800 Subject: [PATCH] ol: No message when previewing images in non-graphical context * lisp/ol.el (org-link-preview-file): Don't message the user when attempting to preview links as images in an environment that doesn't support graphics. This includes the case when `org-link-preview' runs in the Emacs daemon with no frames open. --- lisp/ol.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lisp/ol.el b/lisp/ol.el index 9e2459cde..c21869fbc 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -2178,9 +2178,7 @@ (defun org-link-preview-file (ov path link) This is intended to be used as the `:preview' link property of file links, see `org-link-parameters'." - (if (not (display-graphic-p)) - (prog1 nil - (message "Your Emacs does not support displaying images!")) + (when (display-graphic-p) (require 'image) (when-let* ((file-full (expand-file-name path)) (file (substitute-in-file-name file-full)) -- 2.47.0