From 04c2eaca647afb3da42cd62574c7380d895afd6c Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 1 May 2014 21:53:24 -0400 Subject: Fix bog-bib-citekeys when bog-bib-file is non-nil --- bog.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bog.el b/bog.el index 25d2792..975b60e 100644 --- a/bog.el +++ b/bog.el @@ -483,11 +483,16 @@ occur in buffer instead of alphabetical order." (expand-file-name (concat citekey ".bib") bog-bib-directory)) (defun bog-bib-citekeys () - "Return a list citekeys for all BibTeX files in `bog-bib-directory'." - (-map 'file-name-base - (file-expand-wildcards (concat - (file-name-as-directory bog-bib-directory) - "*.bib")))) + "Return a list citekeys for all BibTeX entries. +If `bog-bib-file' is non-nil, it returns citekeys from this file +instead of citekeys from file names in `bog-bib-directory'." + (if bog-bib-file + (with-current-buffer (find-file-noselect bog-bib-file) + (-map 'car (bibtex-parse-keys))) + (-map 'file-name-base + (file-expand-wildcards (concat + (file-name-as-directory bog-bib-directory) + "*.bib"))))) ;;; Web -- cgit v1.2.3