emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] org-link-preview-file emits image not supported in daemon [9.8


From: Karthik Chikmagalur
Subject: Re: [BUG] org-link-preview-file emits image not supported in daemon [9.8-pre (release_9.7.10-127-g07dd3b @ /home/bidar/.local/etc/emacs/lib/org/lisp/)]
Date: Fri, 27 Dec 2024 19:50:51 -0800

>>> 1. As a minimum, we can remove that message and do nothing on
>>>    non-graphical displays. It will be consistent with earlier behavior.
>>
>> I will remove that message from org-link-preview-file.
>
> +1

Patch attached.

Karthik
>From 621396f4b5c46f109aaec5afcb0a983153d8a60a Mon Sep 17 00:00:00 2001
From: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]