diff options
author | Sébastien Delafond <sdelafond@gmail.com> | 2016-11-07 10:41:54 +0100 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2016-11-07 10:41:54 +0100 |
commit | 1a7cd65ca362047cd97d4127d49108994baebc6c (patch) | |
tree | f18735f3b77120ef2e91043f2f662b03e47ccbb0 /contrib/lisp/org-bibtex-extras.el | |
parent | 55074078ca876273e3fa58ee6838cba90d2b6100 (diff) | |
parent | ec84430cf4e09ba25ec675debdf802bc28111e06 (diff) |
Merge tag 'upstream/9.0'
Upstream version 9.0
Diffstat (limited to 'contrib/lisp/org-bibtex-extras.el')
-rw-r--r-- | contrib/lisp/org-bibtex-extras.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/lisp/org-bibtex-extras.el b/contrib/lisp/org-bibtex-extras.el index 7b0a89d..587aa67 100644 --- a/contrib/lisp/org-bibtex-extras.el +++ b/contrib/lisp/org-bibtex-extras.el @@ -61,6 +61,8 @@ ;;; Code: (require 'org-bibtex) +(declare-function org-trim "org" (s &optional keep-lead)) + (defcustom obe-bibtex-file nil "File holding bibtex entries.") (defcustom obe-html-link-base nil @@ -91,7 +93,7 @@ For example, to point to your `obe-bibtex-file' use the following. (replace-match (save-match-data (mapconcat (lambda (c) (format "[[%s#%s][%s]]" obe-html-link-base c c)) - (mapcar #'org-babel-trim + (mapcar #'org-trim (split-string (match-string 1) ",")) ", ")))))) (defun obe-meta-to-json (meta &optional fields) @@ -111,12 +113,12 @@ For example, to point to your `obe-bibtex-file' use the following. (add (remove-duplicates (col field) :test #'string=))) ;; build the links in the graph (dolist (citation meta) - (let ((dest (id (cdr (assoc :title citation))))) - (dolist (author (mapcar #'id (cdr (assoc :authors citation)))) + (let ((dest (id (cdr (assq :title citation))))) + (dolist (author (mapcar #'id (cdr (assq :authors citation)))) (when author (push (cons author dest) links))) - (let ((jid (id (cdr (assoc :journal citation))))) + (let ((jid (id (cdr (assq :journal citation))))) (when jid (push (cons jid dest) links))) - (let ((cid (id (cdr (assoc :category citation))))) + (let ((cid (id (cdr (assq :category citation))))) (when cid (push (cons cid dest) links))))) ;; build the json string (format "{\"nodes\":[%s],\"links\":[%s]}" |