diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-12-04 01:28:37 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-12-04 01:28:37 -0500 |
commit | 12e3e07c6843664bb3c750bc644fa05cd70816d0 (patch) | |
tree | 6f0337ac319868c856ac6ee59b8468b016df2b58 /lisp | |
parent | f7a80cc50aaee247807a09a62c821149ee75ed1d (diff) | |
download | emacs.d-12e3e07c6843664bb3c750bc644fa05cd70816d0.tar.gz |
bibtex-clean-entry-hook: Downcase AND in author list
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-bib.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/init-bib.el b/lisp/init-bib.el index c438b90..d81edee 100644 --- a/lisp/init-bib.el +++ b/lisp/init-bib.el @@ -21,6 +21,7 @@ (add-hook 'bibtex-clean-entry-hook 'km/bibtex-remove-entry-space) (add-hook 'bibtex-clean-entry-hook 'km/bibtex-downcase-entry) (add-hook 'bibtex-clean-entry-hook 'km/bibtex-downcase-keys) +(add-hook 'bibtex-clean-entry-hook 'km/bibtex-downcase-author-and) (defvar km/bibtex-unimportant-title-words '("a" "aboard" "about" "above" "absent" "across" "after" "against" @@ -147,6 +148,17 @@ to (replace-match (downcase (match-string 1)) 'fixedcase nil nil 1))))) +(defun km/bibtex-downcase-author-and () + (save-excursion + (bibtex-beginning-of-entry) + (let ((bounds (bibtex-search-forward-field "author" t))) + (when bounds + (goto-char (bibtex-start-of-text-in-field bounds)) + (let (case-fold-search) + (while (re-search-forward "\\bAND\\b" + (bibtex-end-of-text-in-field bounds) t) + (replace-match (downcase (match-string 0)) 'fixedcase))))))) + (defun km/browse-doi (doi) "Open DOI in browser. When called interactively, take the DOI from the text under |