branch: externals/org
commit 3123caa8e9ce7650edbb227aa6d5acfe213a4793
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-display-inline-images: Expand environment variables in image path
    
    * lisp/org.el (org-display-inline-images): Expand environment
    variables in the link path, just like `org-open-file' does.
    
    Reported-by: Pan Xie <xie...@skyguard.com.cn>
    Link: 
https://orgmode.org/list/7a012430-6084-e693-1a86-f14d0512b...@skyguard.com.cn
---
 lisp/org.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 996e434391..74972722d1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16378,6 +16378,8 @@ buffer boundaries with possible narrowing."
                                   (require 'org-attach)
                                  (ignore-errors (org-attach-expand path)))
                               (expand-file-name path))))
+                  ;; Expand environment variables.
+                  (when file (setq file (substitute-in-file-name file)))
                  (when (and file (file-exists-p file))
                    (let ((width (org-display-inline-image--width link))
                          (old (get-char-property-and-overlay

Reply via email to