diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-02-17 01:05:26 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-02-17 01:54:49 -0500 |
commit | 4dccd56e1fe424ed1af580e29a39c40642618b6b (patch) | |
tree | 28b2f0c591e1e0fdd7bfb62bf32e3b8838eb787d /bog.el | |
parent | 16b8a782adace8044406308049e41c3f572acb91 (diff) | |
download | bog-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.
Diffstat (limited to 'bog.el')
-rw-r--r-- | bog.el | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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. |