[-- Attachment #1: Type: text/plain, Size: 475 bytes --]
Dear all,
the contrib package ox-bibtex.el has a function for jumping to a
specific bibtex citation key. The current regex assumes a particular
indentation style (leading spaces) and only one space between the
CUSTOM_ID key and the value of that key. This small patch (hopefully)
generalizes the search regex.
I've done only some simple testing but seems to work for my
configuration.
Thank you,
eric
--
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.6-520-ge69937
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-generalize-search-pattern-for-finding-bibtex-entry.patch --]
[-- Type: text/x-diff, Size: 1111 bytes --]
From a5439ba716978a447274993a2b77cf8e2898c530 Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Fri, 24 Apr 2020 11:46:28 +0100
Subject: [PATCH] generalize search pattern for finding bibtex entry
* ox-bibtex.el (org-bibtex-goto-citation): The search regex for
finding a particular citation assumed a particular indentation style
for properties. This change generalizes the regex to work
independently of the indentation style.
---
contrib/lisp/ox-bibtex.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/lisp/ox-bibtex.el b/contrib/lisp/ox-bibtex.el
index 47e2d5dcc..16d538ee5 100644
--- a/contrib/lisp/ox-bibtex.el
+++ b/contrib/lisp/ox-bibtex.el
@@ -163,7 +163,7 @@ to `org-bibtex-citation-p' predicate."
(find-file (or org-bibtex-file
(error "`org-bibtex-file' has not been configured")))
(goto-char (point-min))
- (when (re-search-forward (format " :CUSTOM_ID: %s" citation) nil t)
+ (when (re-search-forward (format "[ \t]*:CUSTOM_ID:[ \t]+%s" citation) nil t)
(outline-previous-visible-heading 1)
t)))
--
2.25.0