diff --git a/contrib/lisp/org-bibtex-extras.el b/contrib/lisp/org-bibtex-extras.el index 8d5b2ac9e..5f050397f 100644 --- a/contrib/lisp/org-bibtex-extras.el +++ b/contrib/lisp/org-bibtex-extras.el @@ -83,19 +83,6 @@ For example, to point to your `obe-bibtex-file' use the following. obe-citations)) obe-citations))) -(defun obe-goto-citation (&optional citation) - "Visit a citation given its ID." - (interactive) - (let ((citation (or citation - (org-icompleting-read "Citation: " - (obe-citations))))) - (find-file (or obe-bibtex-file - (error "`obe-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))) - (defun obe-html-export-citations () "Convert all \\cite{...} citations in the current file into HTML links." (save-excursion @@ -107,15 +94,6 @@ For example, to point to your `obe-bibtex-file' use the following. (mapcar #'org-babel-trim (split-string (match-string 1) ",")) ", ")))))) -(defun obe-get-meta-data (citation) - "Collect meta-data for CITATION." - (save-excursion - (when (obe-goto-citation citation) - (let ((pt (point))) - `((:authors . ,(split-string (org-entry-get pt "AUTHOR") " and " t)) - (:title . ,(org-no-properties (org-get-heading 1 1))) - (:journal . ,(org-entry-get pt "JOURNAL"))))))) - (defun obe-meta-to-json (meta &optional fields) "Turn a list of META data from citations into a string of json." (let ((counter 1) nodes links) diff --git a/contrib/lisp/ox-bibtex.el b/contrib/lisp/ox-bibtex.el index fd9007190..7caa2e25a 100644 --- a/contrib/lisp/ox-bibtex.el +++ b/contrib/lisp/ox-bibtex.el @@ -89,8 +89,6 @@ ;; Initialization (eval-when-compile (require 'cl)) -(let ((jump-fn (car (org-remove-if-not #'fboundp '(ebib obe-goto-citation))))) - (org-add-link-type "cite" jump-fn)) ;;; Internal Functions @@ -149,6 +147,27 @@ to `org-bibtex-citation-p' predicate." (and (string-match "\\`\\\\cite{" value) (substring value (match-end 0) -1))))) + +;;; Follow cite: links + +(defun org-bibtex-file nil "Org-mode file of bibtex entries.") + +(defun org-bibtex-goto-citation (&optional citation) + "Visit a citation given its ID." + (interactive) + (let ((citation (or citation + (org-icompleting-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 ((jump-fn (car (org-remove-if-not #'fboundp '(ebib org-bibtex-goto-citation))))) + (org-add-link-type "cite" jump-fn)) + ;;; Filters