Re: [Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-11-05 Thread Mosè Giordano
Hi Tassilo,

2013/11/5 Tassilo Horn :
> Mosè Giordano  writes:
>
>> [...]
>
> Sounds good to me.  Please add that explanation as a comment to the
> calls.
>

Done, thank you.

Bye,
Mosè

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


Re: [Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-11-05 Thread Tassilo Horn
Mosè Giordano  writes:

>> `LaTeX-bibliography-list' contains both bib files, but
>> `LaTeX-bibitem-list' is nil.  Thus, C-c [ completes nothing (but the
>> bib menu is correct).  After picking one entry from that, the next
>> C-c [ completes only the chosen entry.
>
> You have to get the parsed files associated to the the bibliography
> files first (just edit and save them).

Ah, that does the trick.

>>> Maybe we can add a `TeX-run-style-hooks' inside
>>> `TeX-arg-bibliography' and `LaTeX-arg-addbibresource', what do you
>>> think?
>>
>> Could you elaborate what and why that would achieve?
>
> I suggest to add
> (mapc 'TeX-run-style-hooks styles)
> to the end of `TeX-arg-bibliography' (and something similar to
> `LaTeX-arg-addbibresource'), just like style files of LaTeX packages
> are run inside `LaTeX-arg-usepackage'.  If there is already the parsed
> file associated to the bibliography file, `LaTeX-bibitem-list' will be
> immediately filled without the need to revert the document.  And of
> course we need to hope that the bibliography file has a different name
> from the main document (it's not uncommon to use the same base name),
> but this is a restriction intrinsic to AUCTeX, for the moment.

Sounds good to me.  Please add that explanation as a comment to the
calls.

Bye,
Tassilo

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


Re: [Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-11-04 Thread Mosè Giordano
Hi Tassilo,

2013/11/4 Tassilo Horn :
> Mosè Giordano  writes:
>
> Hi!
>
>> actually your change does fix the problem for me, and now I can add
>> keys from both database files :-) `LaTeX-bibliography-list' has both
>> files and `LaTeX-bibitem-list' contains keys from both files.  The
>> only, minor, problem is that one has to revert the buffer to fill
>> `LaTeX-bibitem-list' after the database files are added with `C-c RET
>> bibliography/addbibresource RET'.
>
> Hm, when I find the existing file
>
> --8<---cut here---start->8---
> \documentclass{article}
> \usepackage{biblatex}
> \addbibresource{texbook1.bib}
> \addbibresource{texbook2.bib}
> \begin{document}
> \printbibliography
> \end{document}
> --8<---cut here---end--->8---
>
> `LaTeX-bibliography-list' contains both bib files, but
> `LaTeX-bibitem-list' is nil.  Thus, C-c [ completes nothing (but the bib
> menu is correct).  After picking one entry from that, the next C-c [
> completes only the chosen entry.
>

You have to get the parsed files associated to the the bibliography
files first (just edit and save them).

>> Maybe we can add a `TeX-run-style-hooks' inside `TeX-arg-bibliography'
>> and `LaTeX-arg-addbibresource', what do you think?
>
> Could you elaborate what and why that would achieve?
>

I suggest to add
(mapc 'TeX-run-style-hooks styles)
to the end of `TeX-arg-bibliography' (and something similar to
`LaTeX-arg-addbibresource'), just like style files of LaTeX packages
are run inside `LaTeX-arg-usepackage'.  If there is already the parsed
file associated to the bibliography file, `LaTeX-bibitem-list' will be
immediately filled without the need to revert the document.  And of
course we need to hope that the bibliography file has a different name
from the main document (it's not uncommon to use the same base name),
but this is a restriction intrinsic to AUCTeX, for the moment.

Bye,
Mosè

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


Re: [Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-11-03 Thread Tassilo Horn
Mosè Giordano  writes:

Hi!

> actually your change does fix the problem for me, and now I can add
> keys from both database files :-) `LaTeX-bibliography-list' has both
> files and `LaTeX-bibitem-list' contains keys from both files.  The
> only, minor, problem is that one has to revert the buffer to fill
> `LaTeX-bibitem-list' after the database files are added with `C-c RET
> bibliography/addbibresource RET'.

Hm, when I find the existing file

--8<---cut here---start->8---
\documentclass{article}
\usepackage{biblatex}
\addbibresource{texbook1.bib}
\addbibresource{texbook2.bib}
\begin{document}
\printbibliography
\end{document}
--8<---cut here---end--->8---

`LaTeX-bibliography-list' contains both bib files, but
`LaTeX-bibitem-list' is nil.  Thus, C-c [ completes nothing (but the bib
menu is correct).  After picking one entry from that, the next C-c [
completes only the chosen entry.

> Maybe we can add a `TeX-run-style-hooks' inside `TeX-arg-bibliography'
> and `LaTeX-arg-addbibresource', what do you think?

Could you elaborate what and why that would achieve?

Bye,
Tassilo

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


Re: [Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-11-02 Thread Mosè Giordano
Hi Tassilo,

actually your change does fix the problem for me, and now I can add
keys from both database files :-)  `LaTeX-bibliography-list' has both
files and `LaTeX-bibitem-list' contains keys from both files.  The
only, minor, problem is that one has to revert the buffer to fill
`LaTeX-bibitem-list' after the database files are added with `C-c RET
bibliography/addbibresource RET'.  Maybe we can add a
`TeX-run-style-hooks' inside `TeX-arg-bibliography' and
`LaTeX-arg-addbibresource', what do you think?

Thank you so much,
bye,
Mosè


2013/11/1 Tassilo Horn :
> Mosè Giordano  writes:
>
> Hi Mosè,
>
>> Following is a minimal working example.
>
> Thank you!
>
> I think I have fixed the problem in revno 114894 on the emacs trunk, at
> least the reftex side of the problem.  (reftex-get-bibfile-list) now
> works correctly (returns both files), but the prompt you get when doing
> C-c [ only completes the entry from the first bib file.
>
> However, that's not a reftex but an AUCTeX problem, because when AUCTeX
> is installed/loaded, `reftex-citation' calls `LaTeX-bibitem-list' to get
> the bib entries.
>
> I don't have time to look into the AUCTeX side of the problem right now.
> Feel free to have a look yourself. :-)
>
> Bye,
> Tassilo

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


Re: [Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-11-01 Thread Tassilo Horn
Mosè Giordano  writes:

Hi Mosè,

> Following is a minimal working example.

Thank you!

I think I have fixed the problem in revno 114894 on the emacs trunk, at
least the reftex side of the problem.  (reftex-get-bibfile-list) now
works correctly (returns both files), but the prompt you get when doing
C-c [ only completes the entry from the first bib file.

However, that's not a reftex but an AUCTeX problem, because when AUCTeX
is installed/loaded, `reftex-citation' calls `LaTeX-bibitem-list' to get
the bib entries.

I don't have time to look into the AUCTeX side of the problem right now.
Feel free to have a look yourself. :-)

Bye,
Tassilo

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


Re: [Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-10-31 Thread Mosè Giordano
Hi Tassilo,

it's really simple: with biblatex one can add bibliography database
files with `\bibliography' (same syntax as LaTeX built-in bibliography
system) or `\addbibresource'.  Here
http://tex.stackexchange.com/q/21439/31416 you can see the main
differences between the two macros.  Both can be used multiple times,
and it's here that RefTeX fails.

Following is a minimal working example.  In order to use RefTeX
`texbook1.bib' and `texbook2.bib' should be in the same directory of
the document.  They come with a full TeX Live, but you can also
download them from http://tug.ctan.org/tex-archive/info/biblio/  If
you prefer, use your own bibliography files.

--8<---cut here---start->8---
\documentclass{article}
\usepackage{biblatex}

\addbibresource{texbook1.bib}
\addbibresource{texbook2.bib}
\begin{document}
\cite{Abdelhamid:VLB92} % in texbook1.bib
\cite{Abelson:SIC85} % in texbook2.bib
\printbibliography
\end{document}
--8<---cut here---end--->8---

The user should be able to insert both citation keys using RefTeX, but
it will use only keys from `texbook1.bib'.   A workaround is to use a
comma separated list of files with `\bibliography', but
`\addbibresource' is the standard biblatex way to specify bibliography
resources and it must be given one resource per macro.  As I already
said, AUCTeX without RefTeX uses correctly both bibliography
databases.

Bye,
Mosè


2013/10/31 Tassilo Horn :
> Mosè Giordano  writes:
>
> Hi!
>
>> sorry, I didn't specify that this occurs when the bibliography is
>> typeset using biblatex, with that package it's legal to use more than
>> one `\bibliography'.  Moreover, using `\addbibresource' instead of
>> `\bibliography' (and this is the standard in `biblatex') it's
>> impossible to use a comma separated list of bibliography database
>> files, so multiple `\addbibresource's are needed.
>
> Ah, I see.  I've never used biblatex myself.  Could you please attach a
> minimal, commended tex file that demonstrates and explains all valid
> (and invalid) possibilities of including bibliographies when using
> biblatex.
>
> Bye,
> Tassilo

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


Re: [Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-10-31 Thread Tassilo Horn
Mosè Giordano  writes:

Hi!

> sorry, I didn't specify that this occurs when the bibliography is
> typeset using biblatex, with that package it's legal to use more than
> one `\bibliography'.  Moreover, using `\addbibresource' instead of
> `\bibliography' (and this is the standard in `biblatex') it's
> impossible to use a comma separated list of bibliography database
> files, so multiple `\addbibresource's are needed.

Ah, I see.  I've never used biblatex myself.  Could you please attach a
minimal, commended tex file that demonstrates and explains all valid
(and invalid) possibilities of including bibliographies when using
biblatex.

Bye,
Tassilo

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


Re: [Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-10-29 Thread Mosè Giordano
Hi Tassilo,

sorry, I didn't specify that this occurs when the bibliography is
typeset using biblatex, with that package it's legal to use more than
one `\bibliography'.  Moreover, using `\addbibresource' instead of
`\bibliography' (and this is the standard in `biblatex') it's
impossible to use a comma separated list of bibliography database
files, so multiple `\addbibresource's are needed.

Bye,
Mosè


2013/10/29 Tassilo Horn :
> Mosè Giordano  writes:
>
> Hi Mosè,
>
>> it seems RefTeX (I'm running Emacs 24.3.1) cannot manage multiple
>> bibliography database files specified using multiple `\bibliography'
>> macros.  Consider these examples:
>>
>>   \bibliography{foo,bar}
>>
>> and
>>
>>   \bibliography{foo}
>>   \bibliography{bar}
>
> The second version isn't legal, i.e., bibtex itself can't handle it.
> Here's what bibtex says on a test document (foo is bib1 in there, bar is
> bib2).
>
> --8<---cut here---start->8---
> Running `BibTeX' on `bar' with ``bibtex bar''
> This is BibTeX, Version 0.99d (TeX Live 2013)
> The top-level auxiliary file: bar.aux
> The style file: alpha.bst
> Illegal, another \bibdata command---line 8 of file bar.aux
>  : \bibdata
>  : {bib2}
> I'm skipping whatever remains of this command
> Database file #1: bib1.bib
> Warning--I didn't find a database entry for "bib2book"
> (There was 1 error message)
>
> TeX Output exited abnormally with code 2 at Tue Oct 29 08:27:50
> --8<---cut here---end--->8---
>
> So it only uses the first database file, and that's exactly what
> `reftex-get-bibfile-list' returns.
>
> Bye,
> Tassilo

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


Re: [Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-10-29 Thread Tassilo Horn
Mosè Giordano  writes:

Hi Mosè,

> it seems RefTeX (I'm running Emacs 24.3.1) cannot manage multiple
> bibliography database files specified using multiple `\bibliography'
> macros.  Consider these examples:
>
>   \bibliography{foo,bar}
>
> and
>
>   \bibliography{foo}
>   \bibliography{bar}

The second version isn't legal, i.e., bibtex itself can't handle it.
Here's what bibtex says on a test document (foo is bib1 in there, bar is
bib2).

--8<---cut here---start->8---
Running `BibTeX' on `bar' with ``bibtex bar''
This is BibTeX, Version 0.99d (TeX Live 2013)
The top-level auxiliary file: bar.aux
The style file: alpha.bst
Illegal, another \bibdata command---line 8 of file bar.aux
 : \bibdata
 : {bib2}
I'm skipping whatever remains of this command
Database file #1: bib1.bib
Warning--I didn't find a database entry for "bib2book"
(There was 1 error message)

TeX Output exited abnormally with code 2 at Tue Oct 29 08:27:50
--8<---cut here---end--->8---

So it only uses the first database file, and that's exactly what
`reftex-get-bibfile-list' returns.

Bye,
Tassilo

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


[Bug-AUCTeX] RefTeX cannot manage multiple "bibliography" macros

2013-10-28 Thread Mosè Giordano
Hi all,

it seems RefTeX (I'm running Emacs 24.3.1) cannot manage multiple
bibliography database files specified using multiple `\bibliography'
macros.  Consider these examples:

  \bibliography{foo,bar}

and

  \bibliography{foo}
  \bibliography{bar}

(`foo' and `bar' must be two existent database files).  In the first
case `reftex-get-bibfile-list' returns something like

  ("/tmp/foo.bib" "/tmp/bar.bib")

while in the second only

  ("/tmp/foo.bib")

I'm not familiar with RefTeX code, can someone please look at this
problem?  It's a RefTeX-only problem, AUCTeX without RefTeX works as
expected in both cases.

Thank you,
bye,
Mosè

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