From f068094cc850e7387633bbd57e1c0bfc7e395b21 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Wed, 29 Mar 2023 16:13:29 +0200 Subject: [PATCH] org-cite-list-bibliography-files: Preserve local bibliography path * lisp/oc.el (org-cite-list-bibliography-files): When the bibliography path is relative to the exported file location, keep the path relative. Link: https://orgmode.org/list/CAO48Bk_upR4h-xd0YL+FxeKtWvDoqH+Eju6F_Vzds_m6oxBKcg@mail.gmail.com --- lisp/oc.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/oc.el b/lisp/oc.el index dde6f3a32..a69165506 100644 --- a/lisp/oc.el +++ b/lisp/oc.el @@ -602,7 +602,12 @@ (defun org-cite-list-bibliography-files () (append (mapcar (lambda (value) (pcase value (`(,f . ,d) - (expand-file-name (org-strip-quotes f) d)))) + ;; Keep the bibliography path relative in + ;; current directory. + (if (equal d default-directory) f + ;; Expand bibliography path for #+SETUP + ;; files located in other directory. + (expand-file-name (org-strip-quotes f) d))))) (pcase (org-collect-keywords '("BIBLIOGRAPHY") nil '("BIBLIOGRAPHY")) (`(("BIBLIOGRAPHY" . ,pairs)) pairs))) -- 2.39.1