branch: externals/org-transclusion commit fca021693f176e35a2ae7051d074eef95de05c60 Author: Joseph Turner <jos...@breatheoutbreathe.in> Commit: Joseph Turner <jos...@breatheoutbreathe.in>
fix: Check link :type is "file" before attempting file transclusion --- org-transclusion.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/org-transclusion.el b/org-transclusion.el index efbefc5b01..4a2bf27a4a 100644 --- a/org-transclusion.el +++ b/org-transclusion.el @@ -964,15 +964,17 @@ Return nil if not found." (defun org-transclusion-add-org-file (link plist) "Return a list for Org file LINK object and PLIST. Return nil if not found." - (when (org-transclusion-org-file-p (org-element-property :path link)) - (append '(:tc-type "org-link") - (org-transclusion-content-org-link link plist)))) + (and (string= "file" (org-element-property :type link)) + (org-transclusion-org-file-p (org-element-property :path link)) + (append '(:tc-type "org-link") + (org-transclusion-content-org-link link plist)))) (defun org-transclusion-add-other-file (link plist) "Return a list for non-Org file LINK object and PLIST. Return nil if not found." - (append '(:tc-type "others-default") - (org-transclusion-content-others-default link plist))) + (and (string= "file" (org-element-property :type link)) + (append '(:tc-type "others-default") + (org-transclusion-content-others-default link plist)))) ;;----------------------------------------------------------------------------- ;;;; Functions for inserting content