summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-09-20 20:24:36 -0400
committerKyle Meyer <kyle@kyleam.com>2015-09-20 20:24:36 -0400
commit2d617864119bebbdef60bfce5f23a9eb70ace86a (patch)
treef3a266566fc243429ba89b512d639aa21686f935 /lisp
parent3ee90a75611ef1a2c75487b52aac799bf69daefd (diff)
downloademacs.d-2d617864119bebbdef60bfce5f23a9eb70ace86a.tar.gz
bibtex-clean-entry-hook: Remove entry space
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-bib.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/init-bib.el b/lisp/init-bib.el
index 8cc4a1a..aa4cd6b 100644
--- a/lisp/init-bib.el
+++ b/lisp/init-bib.el
@@ -18,6 +18,7 @@
(add-hook 'bibtex-clean-entry-hook 'km/bibtex-pages-use-double-hyphen)
(add-hook 'bibtex-clean-entry-hook 'km/bibtex-remove-doi-leader)
(add-hook 'bibtex-clean-entry-hook 'km/bibtex-set-coding-system)
+(add-hook 'bibtex-clean-entry-hook 'km/bibtex-remove-entry-space)
(defvar km/bibtex-unimportant-title-words
'("a" "aboard" "about" "above" "absent" "across" "after" "against"
@@ -94,6 +95,20 @@ all other words unless they are protected by brackets."
(defun km/bibtex-set-coding-system ()
(set-buffer-file-coding-system 'utf-8))
+(defun km/bibtex-remove-entry-space ()
+ "Remove space in entry header.
+For example, convert
+
+ @article {
+
+to
+
+ @article{"
+ (save-excursion
+ (bibtex-beginning-of-entry)
+ (when (looking-at "@\\w+\\(\\s-+\\)")
+ (replace-match "" nil nil nil 1))))
+
(defun km/bibtex-pages-use-double-hyphen ()
"Use double hyphen for page range."
(interactive)