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: Mon, 23 Jun 2025 21:55:09 +0200

Hi again, thanks for taking the time and sorry that my instructions
were still unclear. I can't reproduce the bug with your commands only,
but I can reproduce it if I add this line
(setq latexenc-dont-use-TeX-master-flag nil)
as mentioned in my previous email.

Consider this "init.el" file:
--8<---------------cut here---------------start------------->8---
(package-initialize t)
(package-activate 'auctex)

;; I use this:
;(add-to-list 'load-path "~/.config/emacs/.local/straight/build-30.1/auctex")
;(load "auctex-autoloads.el" nil t t)

(setq TeX-parse-self t)
(add-hook 'LaTeX-mode-hook #'reftex-mode)
(setq reftex-plug-into-AUCTeX t)

;; Either uncomment this and keep the "TeX-master" line in biblatex-sub.tex
(setq-default TeX-master nil)
(setq latexenc-dont-use-TeX-master-flag t)

;; Or uncomment this and remove the TeX-master-line in biblatex-sub.tex
;(setq latexenc-dont-use-TeX-master-flag nil)
;(setq-default TeX-master "biblatex-main")

(find-file "./biblatex-sub.tex")

;; Print to stdout for quicker debugging
(print (reftex-get-bibfile-list) 'external-debugging-output)
--8<---------------cut here---------------end------------->8---

Here are step-by-step instructions:
 * Save your minimal set of files in a temp directory
 * Add an init.el file as above to the directory
 * cd to the temp directory
 * Run: emacs --init-directory=. --no-splash

Expected outcome:
 * Two file paths are printed to stdout
 * If you try to add a citation, both entries are found 

Actual outcome:
 * Only one file paths is printed to stdout
 * If you try to add a citation, only one entry is found

Best,
Tim