瀏覽代碼

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 5 年之前
父節點
當前提交
7cdc023f88
共有 1 個文件被更改,包括 2 次插入4 次删除
  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))