From 47c7bbc277448bd54a5895a6280f27b17183c2e6 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 8 Sep 2015 22:54:05 -0400 Subject: bibtex-single-space-author-list: Check if field exists --- lisp/init-bib.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lisp') 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." -- cgit v1.2.3