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 <e.fraga@ucl.ac.uk>
<http://lists.gnu.org/r/emacs-orgmode/2020-04/msg00383.html>
This commit is contained in:
Nicolas Goaziou 2020-04-24 22:22:43 +02:00
parent 178e47a0c5
commit 7cdc023f88
1 changed files with 2 additions and 4 deletions

View File

@ -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))