Fix backend spec parent resolution

Instead of looking for the first spec that is a parent of the given
backend, try to find the first backend along the backend-parent chain
that has a spec.
This commit is contained in:
TEC 2023-01-18 23:05:06 +08:00
parent cf5c8d269f
commit 62153ffa13
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 10 additions and 6 deletions

View File

@ -1080,12 +1080,16 @@ The actual update is performed by `org-glossary--update-buffers'."
The information is extracted from `org-glossary-export-specs'."
(let* ((default-spec (alist-get t org-glossary-export-specs))
(current-spec
(or (cl-some
(lambda (export-spec)
(when (org-export-derived-backend-p backend (car export-spec))
(cdr export-spec)))
org-glossary-export-specs)
default-spec))
(cl-loop for back = (if (symbolp backend)
(org-export-get-backend backend)
backend)
then (org-export-get-backend
(org-export-backend-parent
back))
unless back return default-spec
for spec = (alist-get (org-export-backend-name back)
org-glossary-export-specs)
when spec return spec))
(default-template
(org-combine-plists (alist-get t default-spec)
(alist-get t current-spec)))