Re: [AUCTeX-devel] Override autodetection of biblatex backend

2014-04-04 Thread Tassilo Horn
Mosè Giordano giordano.m...@libero.it writes:

Hi Mosè,

 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.

I probably should start using it then. :-)

 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
 (setq LaTeX-using-Biber
   (if (local-variable-p 'LaTeX-biblatex-use-Biber)
   LaTeX-biblatex-use-Biber))
 without further checks.

Seems fine to me, so feel free to install it.

Bye,
Tassilo


___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] Override autodetection of biblatex backend

2014-04-04 Thread Mosè Giordano
Hi Tassilo

2014-04-04 14:03 GMT+02:00 Tassilo Horn t...@gnu.org:
 Mosè Giordano giordano.m...@libero.it writes:

 Hi Mosè,

 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.

 I probably should start using it then. :-)

Yes, you really should! ;-)

 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
 (setq LaTeX-using-Biber
   (if (local-variable-p 'LaTeX-biblatex-use-Biber)
   LaTeX-biblatex-use-Biber))
 without further checks.

 Seems fine to me, so feel free to install it.

Thank you, done.  In addition, I also moved advising of
`LaTeX-add-environments' after definition of`LaTeX-environment-menu'
and `LaTeX-environment-modify-menu' because every time I opened a
LaTeX document, a *Compile-Log* buffer was created complaining about
assignment to free variables.

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] Override autodetection of biblatex backend

2014-04-02 Thread Mosè Giordano
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