Browse Source

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>
Nicolas Goaziou 1 year ago
parent
commit
7cdc023f88
1 changed files with 2 additions and 4 deletions
  1. 2 4
      contrib/lisp/ox-bibtex.el

+ 2 - 4
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))