The bibtex-fill-entry
(C-c C-q) command of Emacs's BibTeX-Mode automatically aligns and wraps messily formatted BibTeX entries. For example, it can take an entry like
@Article{smith1980,
author = {John Smith},
title = {How I Weave Baskets Underwater},
journal = {Journal of
Underwater Basket
Weaving and Nonsensical Latin Placeholder Texts},
year = 1980,
abstract = {Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.},
}
and beautify it into
@Article{smith1980,
author = {John Smith},
title = {How I Weave Baskets Underwater},
journal = {Journal of Underwater Basket Weaving and Nonsensical
Latin Placeholder Texts},
year = 1980,
abstract = {Lorem ipsum dolor sit amet, consectetur adipiscing
elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore
eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.},
}
I like the fact that the fields and values are aligned, but I would prefer it if the values were not word-wrapped. That is, I would prefer it if the output of bibtex-fill-entry
on the above example were
@Article{smith1980,
author = {John Smith},
title = {How I Weave Baskets Underwater},
journal = {Journal of Underwater Basket Weaving and Nonsensical Latin Placeholder Texts},
year = 1980,
abstract = {Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.},
}
This allows me to more easily browse long BibTeX files with toggle-truncate-lines
, or with any other text editor that truncates rather than wraps long lines. Is there any way I can configure BibTeX-Mode to do this?
bibtex-fill-entry
does, such as removing extraneous braces. I just don't want it to wrap lines. From what I can tell, the function you linked to performs indentation only – I don't think it even bothers unwrapping lines, let alone any other tweaking.