* org-bibtex.el (org-bibtex-read): Organize `org-bibtex-read' function into two functions, so that it can be used by other functions without storing the result in `org-bibtex-entries'.
TINY CHANGE Signed-off-by: Stefan-W. Hahn <stefan.h...@s-hahn.de> --- lisp/org-bibtex.el | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el index ed645e5..7a12c30 100644 --- a/lisp/org-bibtex.el +++ b/lisp/org-bibtex.el @@ -603,10 +603,9 @@ (defun org-bibtex-create-in-current-entry (&optional arg) (interactive "P") (org-bibtex-create arg t)) -(defun org-bibtex-read () +(defun org-bibtex-read-internal () "Read a bibtex entry and save to `org-bibtex-entries'. This uses `bibtex-parse-entry'." - (interactive) (let ((keyword (lambda (str) (intern (concat ":" (downcase str))))) (clean-space (lambda (str) (replace-regexp-in-string "[[:space:]\n\r]+" " " str))) @@ -617,16 +616,21 @@ (defun org-bibtex-read () (= (aref str 0) (car pair)) (= (aref str (1- (length str))) (cdr pair))) (setf str (substring str 1 (1- (length str)))))) str))) - (push (mapcar - (lambda (pair) - (cons (let ((field (funcall keyword (car pair)))) - (case field - (:=type= :type) - (:=key= :key) - (otherwise field))) - (funcall clean-space (funcall strip-delim (cdr pair))))) - (save-excursion (bibtex-beginning-of-entry) (bibtex-parse-entry))) - org-bibtex-entries))) + (mapcar + (lambda (pair) + (cons (let ((field (funcall keyword (car pair)))) + (case field + (:=type= :type) + (:=key= :key) + (otherwise field))) + (funcall clean-space (funcall strip-delim (cdr pair))))) + (save-excursion (bibtex-beginning-of-entry) (bibtex-parse-entry))))) + +(defun org-bibtex-read () + "Read a bibtex entry and save to `org-bibtex-entries'. +This uses `bibtex-parse-entry'." + (interactive) + (push (org-bibtex-read-internal) org-bibtex-entries)) (defun org-bibtex-read-buffer (buffer) "Read all bibtex entries in BUFFER and save to `org-bibtex-entries'. -- 1.8.3.2.733.gf8abaeb