Subject: 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: Tue, 24 Jun 2025 10:50:49 +0200

Thanks for the quick reply!

On Tue, 2025-06-24 at 10:14 +0200, Arash Esbati wrote:
> Ok.  But this is not a real requirement, right?  This is just to
> showcase the issue.  Your setup involves setting `TeX-master' to a
> constant string, right?  If so, can you please delete this line:
> 

Indeed, this is just to showcase the issue. See the comments in my
"init.el" snippet from my previous mail which have instructions to
reproduce the issue without the "%%% TeX-master:" line.

> (IIUC, `latexenc-find-file-coding-system' isn't
> prepared to deal with `TeX-master' set to a string top-level.  My
> change
> above adds that.

I've tested this, and this works in this specific case. But are you
really suggesting this as a fix? 

I feel this is building a hack on top of another. If AUCTeX needs the
master file to be open, then it just should open it and not rely on
latexenc to open it.

Your change doesn't solve the issue if any of the following happens:
 * latexenc-dont-use-TeX-master-flag is t
 * latexenc will be removed or changed in the future
 * the \addbibresource commands is not in the same file as
   \usepackage{biblatex}, see the test case in the attached zip.
   (Again, extract it to some folder, cd into the folder with the tex
   files, and run `emacs --init-directory=. --no-splash`)