From 7cdc023f886707df06d7a5c5f8fbd69900e346c9 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 24 Apr 2020 22:22:43 +0200 Subject: [PATCH] bibtex: Fix `org-bibtex-goto-citation' * contrib/lisp/ox-bibtex.el (org-bibtex-goto-citation): Fix `org-bibtex-goto-citation'. Reported-by: Eric S Fraga --- contrib/lisp/ox-bibtex.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/contrib/lisp/ox-bibtex.el b/contrib/lisp/ox-bibtex.el index 47e2d5dcc..af8da6e87 100644 --- a/contrib/lisp/ox-bibtex.el +++ b/contrib/lisp/ox-bibtex.el @@ -162,10 +162,8 @@ to `org-bibtex-citation-p' predicate." (let ((citation (or citation (completing-read "Citation: " (obe-citations))))) (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) - (outline-previous-visible-heading 1) - t))) + (let ((position (org-find-property "CUSTOM_ID" citation))) + (and position (progn (goto-char position) t))))) (let ((jump-fn (car (cl-remove-if-not #'fboundp '(ebib org-bibtex-goto-citation))))) (org-add-link-type "cite" jump-fn))