summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustav Wikström <gustav@whil.se>2019-10-26 02:29:55 +0200
committerGustav Wikström <gustav@whil.se>2019-10-26 02:38:53 +0200
commit58ceff522bec39ca4511024a0ad747e2135919f9 (patch)
tree418a4f154d39e59dacba4b2b99e3b47194546268
parent28bb1c81fad9caf4d7867d4f17451c5b21df33bb (diff)
downloadorg-mode-58ceff522bec39ca4511024a0ad747e2135919f9.tar.gz
Handle attachment links more gracefully when expanding inline images
* lisp/org.el (org-display-inline-images): Introduce error-handling to ignore image display if the attachment link cannot be expanded for whatever reason. For example if attachments are relative to the buffer, but the buffer is temporary and lacks filesystem location.
-rw-r--r--lisp/org.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 2fd38b8..f292982 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16722,9 +16722,9 @@ boundaries."
(let ((file (if (equal "attachment" linktype)
(progn
(require 'org-attach)
- (org-attach-expand path))
+ (ignore-errors (org-attach-expand path)))
(expand-file-name path))))
- (when (file-exists-p file)
+ (when (and file (file-exists-p file))
(let ((width
;; Apply `org-image-actual-width' specifications.
(cond