From 5358fb0f6995f56c550a7f29de6efd6ce4ea39b9 Mon Sep 17 00:00:00 2001 From: TEC Date: Sun, 24 Jul 2022 03:14:43 +0800 Subject: [PATCH] Allow fetching extra sources from a parse tree --- org-glossary.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org-glossary.el b/org-glossary.el index fcd7420..e3988a2 100644 --- a/org-glossary.el +++ b/org-glossary.el @@ -1714,7 +1714,7 @@ This should only be run as an export hook." (org-with-wide-buffer (font-lock-flush)))) -(defun org-glossary--get-extra-term-sources () +(defun org-glossary--get-extra-term-sources (&optional parse-tree) "Identify all applicable sources of extra terms for the current buffer. This combines locations listed in `org-glossary-global-terms' with local sources specified with \"#+glossary_sources: LOCATIONS\". @@ -1739,7 +1739,7 @@ location." (org-babel-balanced-split (or (mapconcat #'identity - (org-element-map (org-element-parse-buffer) 'keyword + (org-element-map (or parse-tree (org-element-parse-buffer)) 'keyword (lambda (keyword) (and (equal "GLOSSARY_SOURCES" (org-element-property :key keyword)) (org-element-property :value keyword))))