Arash Esbati wrote (Wed, Jan 24, 2024 at 09:45:17AM +0100): > Mandar Mitra <mandar.mi...@gmail.com> writes: > > > When I run cal-tex-cursor-month in calendar mode, I'm supposed to get > > a LaTeX calendar buffer for the month the cursor is on. This works as > > expected with emacs -Q, but in my setup (using auctex), I'm getting a > > "Wrong type argument: stringp, nil" error. > > I tried your recipe with my setup and get no error. I did: > > • Start Emacs with my setup (no -Q) > • eval'ed (add-hook 'latex-mode-hook #'turn-on-reftex) > • M-x calendar RET t m > > I get a latex buffer which is in LaTeX mode defined in tex-mode.el and > not the mode provided by AUCTeX. I'm using the latest version for > AUCTeX git repo.
Thanks! That makes sense: the source of my error is the TeX-master-file function, so you don't run into the error because AUCTeX doesn't get activated for you. Apologies if this is a stupid question, but how is it that you get the inbuilt latex-mode in a .tex buffer rather than AUCtex, even with AUCtex installed? After digging some more, it appears that I have some kind of advice that overrides latex-mode with TeX-latex-mode.el. This is what C-h m shows in the calendar.tex buffer: --------------------------------------------------------------------------- The major mode is LaTeX/FPS mode defined in tex-mode.el: This function has :override advice: ‘TeX-latex-mode’. This is an :override advice, which means that ‘latex-mode’ isn’t run at all, and the documentation below may be irrelevant. --------------------------------------------------------------------------- grep and family didn't provide any hints about where I might have done this: all hits for TeX-latex-mode are inside elpa/auctex-13.2.4. I don't suppose you'd have any suggestions about how/where to look? Thanks, Mandar.