소스 검색

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.
Gustav Wikström 5 년 전
부모
커밋
58ceff522b
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      lisp/org.el

+ 2 - 2
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