Subject: Re: bug#78841: reftex-get-bibfile-list fails to detect biblatex if there's no buffer for the main file

From: Tim Ruffing <[email-masked]>
Date: Fri, 11 Jul 2025 08:58:07 +0200

On Thu, 2025-07-10 at 17:50 +0200, Arash Esbati wrote:
> TBH, I'm reluctant about changing code which served well for more
> than a
> decade.  And IIRC, we're talking about some corner cases.  So my vote
> is
> to leave this now as is.  

I agree that changing latexenc-dont-use-TeX-master-flag is obscure but
the other case "the \addbibresource commands is not in the same file as
\usepackage{biblatex}" is a not really a corner case. It's perfectly
valid use case.

But yes, I can understand that you're conservative about changing old
code. I promise that is my last attempt to convince you. :)

> I'm afraid that someone will come back to
> us
> and says: I use bibtex and have a .tex file like this:
> 
>   \documentclass{article}
>   \bibliographystyle{plain}
>   \begin{document}
>   Text
>   \bibliography{biblatex-bib1}
>   \bibliography{biblatex-bib2}
>   \end{document}
> 
> And now, RefTeX shows me also not usable entries from
> biblatex-bib2.bib.

Ok, if that's your primary concern, then I don't think it's real. This
is the output of bibtex when I put your example in test.tex (and
similar for bibtexu and bibtex8):

```
This is BibTeX, Version 0.99d (TeX Live 2026/dev/Arch Linux)
The top-level auxiliary file: test.aux
The style file: plain.bst
Illegal, another \bibdata command---line 4 of file test.aux
 : \bibdata
 :         {biblatex-bib2}
I'm skipping whatever remains of this command
I found no \citation commands---while reading file test.aux
Database file #1: biblatex-bib1.bib
(There were 2 error messages)
```

So even compilation will give you an error. I don't think that the user
will expect RefTeX to work on invalid documents. 

Or more pragmatically speaking: If you use bibtex and have two
\bibliography command, you get a meaningful error message. If you use
biblatex and run into the bug that the second bibfile is not used,
because the \addbibresource command is not in the same file as
\usepackage{biblatex}, then you have no idea what's going on.

Best,
Tim