summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-02-17 01:05:26 -0500
committerKyle Meyer <kyle@kyleam.com>2015-02-17 01:54:49 -0500
commit4dccd56e1fe424ed1af580e29a39c40642618b6b (patch)
tree28b2f0c591e1e0fdd7bfb62bf32e3b8838eb787d
parent16b8a782adace8044406308049e41c3f572acb91 (diff)
downloadbog-4dccd56e1fe424ed1af580e29a39c40642618b6b.tar.gz
prepare-bib-file: Fix use of bibtex-key-in-head
Set the match data according to bibtex-entry-head before calling bibtex-key-in-head. bibtex-key-in-head relies on bibtex-entry-head having generated the most recent match data, but I was using it as though it took care of the matching. By luck, it seems that the most recent match data tends to be correct right after cleaning the entry.
-rw-r--r--bog.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/bog.el b/bog.el
index 18b3e93..3ee30c1 100644
--- a/bog.el
+++ b/bog.el
@@ -617,8 +617,10 @@ one entry per BibTeX file."
(insert-file-contents file)
(bibtex-skip-to-valid-entry)
(bibtex-clean-entry new-key)
- (setq bib-file (expand-file-name (concat (bibtex-key-in-head) ".bib")
- new-directory))
+ (if (looking-at bibtex-entry-head)
+ (setq bib-file (expand-file-name (concat (bibtex-key-in-head) ".bib")
+ new-directory))
+ (error "BibTeX header line looks wrong"))
(write-file bib-file))
;; If a buffer was visiting the original bib file, point it to the
;; new file.