summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-09-08 22:54:05 -0400
committerKyle Meyer <kyle@kyleam.com>2015-09-08 22:54:05 -0400
commit47c7bbc277448bd54a5895a6280f27b17183c2e6 (patch)
treeb6af431593cadccc00c6464be3bd2367684b4a12 /lisp
parent3b3c84d783528eb926f2987b5a866ca55a7e3fff (diff)
downloademacs.d-47c7bbc277448bd54a5895a6280f27b17183c2e6.tar.gz
bibtex-single-space-author-list: Check if field exists
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-bib.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/init-bib.el b/lisp/init-bib.el
index 1c44bbe..e04ff8e 100644
--- a/lisp/init-bib.el
+++ b/lisp/init-bib.el
@@ -83,11 +83,12 @@ all other words unless they are protected by brackets."
(let* ((text-bounds (cdr (bibtex-search-forward-field "author" t)))
(beg (car text-bounds))
(end (cadr text-bounds)))
- (goto-char beg)
- (while (re-search-forward "\\(\\s-+\\) and" end t)
- (replace-match "" nil nil nil 1))
- (goto-char beg)
- (fill-paragraph))))
+ (when text-bounds
+ (goto-char beg)
+ (while (re-search-forward "\\(\\s-+\\) and" end t)
+ (replace-match "" nil nil nil 1))
+ (goto-char beg)
+ (fill-paragraph)))))
(defun km/bibtex-pages-use-double-hyphen ()
"Use double hyphen for page range."