branch: externals/auctex
commit 3a5ed086d3fc8869af01ce940c35dd54cdeb8f40
Author: Arash Esbati <[email protected]>
Commit: Arash Esbati <[email protected]>
Support biblatex cite format in all Emacsen
* style/biblatex.el ("biblatex"): Check if biblatex is available
in `reftex-cite-format-builtin' and use it. If not, add entries
for older Emacsen manually.
---
style/biblatex.el | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/style/biblatex.el b/style/biblatex.el
index 32d585a..aa5fcc9 100644
--- a/style/biblatex.el
+++ b/style/biblatex.el
@@ -552,16 +552,35 @@ for citation keys."
"biblatex"
"refsection" "refsegment")
- ;; Tell RefTeX: The entry `biblatex' is defined in
- ;; `reftex-cite-format-builtin' in reftex-vars.el which will be
- ;; part of Emacs >= 25.3. It does not issue an error for older
- ;; Emacsen, but does not work either, i.e. it is ignored.
+ ;; Tell RefTeX: If package option `natbib' is given, activate that
+ ;; format, otherwise stick with `biblatex':
(when (and LaTeX-reftex-cite-format-auto-activate
(fboundp 'reftex-set-cite-format))
(if (or (LaTeX-provided-package-options-member "biblatex" "natbib")
(LaTeX-provided-package-options-member "biblatex" "natbib=true"))
(reftex-set-cite-format 'natbib)
- (reftex-set-cite-format 'biblatex))))
+ ;; The entry `biblatex' is defined in
+ ;; `reftex-cite-format-builtin' in reftex-vars.el which will be
+ ;; part of Emacs >= 25.3. So check here if we find an entry,
+ ;; otherwise do it manually for older Emacsen.
+ (if (assoc 'biblatex reftex-cite-format-builtin)
+ (reftex-set-cite-format 'biblatex)
+ (reftex-set-cite-format
+ '((?\C-m . "\\cite[][]{%l}")
+ (?C . "\\cite*[][]{%l}")
+ (?t . "\\textcite[][]{%l}")
+ (?T . "\\textcite*[][]{%l}")
+ (?p . "\\parencite[][]{%l}")
+ (?P . "\\parencite*[][]{%l}")
+ (?f . "\\footcite[][]{%l}")
+ (?s . "\\smartcite[][]{%l}")
+ (?u . "\\autocite[][]{%l}")
+ (?U . "\\autocite*[][]{%l}")
+ (?a . "\\citeauthor{%l}")
+ (?A . "\\citeauthor*{%l}")
+ (?y . "\\citeyear{%l}")
+ (?Y . "\\citeyear*{%l}")
+ (?n . "\\nocite{%l}")))))))
LaTeX-dialect)
(defvar LaTeX-biblatex-package-options-list