- (if (re-search-forward
- (concat
-; "\\(\\`\\|[\n\r]\\)[^%]*\\\\\\("
- "\\(^\\)[^%\n\r]*\\\\\\("
- (mapconcat 'identity reftex-bibliography-commands "\\|")
- "\\)\\(\\[.+?\\]\\)?{[ \t]*\\([^}]+\\)") nil t)
- (setq files
- (split-string (reftex-match-string 4)
- "[ \t\n\r]*,[ \t\n\r]*")))))
+ ;; when biblatex is used, multiple \bibliography or
+ ;; \addbibresource macros are allowed. With plain bibtex, only
+ ;; the first is used.
+ (let ((using-biblatex (reftex-using-biblatex-p))
+ (again t))
+ (while (and again
+ (re-search-forward
+ (concat
+ ;; "\\(\\`\\|[\n\r]\\)[^%]*\\\\\\("
+ "\\(^\\)[^%\n\r]*\\\\\\("
+ (mapconcat 'identity reftex-bibliography-commands "\\|")
+ "\\)\\(\\[.+?\\]\\)?{[ \t]*\\([^}]+\\)") nil t))
+ (setq files
+ (append files
+ (split-string (reftex-match-string 4)
+ "[ \t\n\r]*,[ \t\n\r]*")))
+ (unless using-biblatex
+ (setq again nil))))))