Hi folks,

I believe we have the best Biber/BibTeX management among all TeX
editor: the user only needs to enable parsing to make AUCTeX selects
for him/her the right backend.  AFAIK, AUCTeX is, for the time being,
the only editor to be able to automatically guess the biblatex
backend.

But, you know, parsing isn't bulletproof and currently we haven't a
way to override the autodetection of the backend.  Attached you can
find a patch to accomplish this: the variable
`LaTeX-biblatex-use-Biber' has been restored (actually I'm not sure
it's a good idea to use the same name of an old and slightly different
variable, other suggestions are welcome) and when it's set locally it
overrides the autodetection of the backend.

My only concern is that we still can't manually select the appropriate
backend when parsing isn't enabled.  Should we also set
`LaTeX-using-Biber' inside `LaTeX-mode-hook'?  Maybe something like
--8<---------------cut here---------------start------------->8---
(setq LaTeX-using-Biber
      (if (local-variable-p 'LaTeX-biblatex-use-Biber)
      LaTeX-biblatex-use-Biber))
--8<---------------cut here---------------end--------------->8---
without further checks.

What do you think?

Bye,
Mosè
diff --git a/style/biblatex.el b/style/biblatex.el
index 600e149..ff2d7d6 100644
--- a/style/biblatex.el
+++ b/style/biblatex.el
@@ -220,11 +220,18 @@ for citation keys."
  "biblatex"
  (lambda ()
    ;; Biblatex uses as default backend biber, run it unless biblatex `backend'
-   ;; option value is one of `bibtex', `bibtex8', `bibtexu'.
+   ;; option value is one of `bibtex', `bibtex8', `bibtexu'.  Autodetection of
+   ;; the backend can be overridden by setting `LaTeX-biblatex-use-Biber' as a
+   ;; local variable.
    (setq LaTeX-using-Biber
-	 (not (or (LaTeX-provided-package-options-member "biblatex" "backend=bibtex")
-		  (LaTeX-provided-package-options-member "biblatex" "backend=bibtex8")
-		  (LaTeX-provided-package-options-member "biblatex" "backend=bibtexu"))))
+	 (if (local-variable-p 'LaTeX-biblatex-use-Biber)
+	     LaTeX-biblatex-use-Biber
+	   (not (or (LaTeX-provided-package-options-member
+		     "biblatex" "backend=bibtex")
+		    (LaTeX-provided-package-options-member
+		     "biblatex" "backend=bibtex8")
+		    (LaTeX-provided-package-options-member
+		     "biblatex" "backend=bibtexu")))))
 
    (TeX-run-style-hooks
     "etoolbox"
diff --git a/tex-style.el b/tex-style.el
index 9975b3f..253d8a6 100644
--- a/tex-style.el
+++ b/tex-style.el
@@ -213,6 +213,16 @@ It can be a list of themes or a function.  If it is the symbol
 	     :tag "Other"
 	     (string)))))
 
+;; style/biblatex.el
+
+(defvar LaTeX-biblatex-use-Biber t
+  "Whether to use Biber with biblatex.
+
+This variable is intended to be used as a file local variable to
+override the autodetection of the biblatex backend.")
+(make-variable-buffer-local 'LaTeX-biblatex-use-Biber)
+(put 'LaTeX-biblatex-use-Biber 'safe-local-variable 'TeX-booleanp)
+
 ;; style/comment.el
 
 (defcustom LaTeX-comment-env-list '("comment")
_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to