As discussed in
https://lists.gnu.org/r/auctex/2022-08/msg00004.html
AUCTeX installs its own advice to redefine `tex-mode`, and that
advice used to take precedence before commit
6075a7c5ae3fa456cd.
says which mode to use."
(tex-common-initialization))
-(advice-add 'tex-mode :around #'tex--redirect-to-submode)
+(advice-add 'tex-mode :around #'tex--redirect-to-submode
+ ;; Give it lower precedence than normal advice, so
+ ;; AUCTeX's advice takes precedence over it.
+ '((depth . 50)))
(defvar tex-mode--recursing nil)
(defun tex--redirect-to-submode (orig-fun)
"Redirect to one of the submodes when called directly."