Re: problem with cal-tex-cursor-month -> reftex-TeX-master-file -> TeX-master-file

2024-01-24 Thread Arash Esbati
Mandar Mitra  writes:

> Many thanks to you for suggesting this disciplined approach, and
> edebug for helping me locate the problem!

You're welcome; happy to hear you have this sorted out.

Best, Arash



Re: problem with cal-tex-cursor-month -> reftex-TeX-master-file -> TeX-master-file

2024-01-24 Thread Mandar Mitra
Apologies for the noise. A file named article.el sitting around in my 
TeX-auto-local directory was the root of the problem (I must have written an 
article.tex at some point of time). After deleting the file, auctex's "real" 
article.el is called and things work as expected.


Arash Esbati wrote (Wed, Jan 24, 2024 at 11:46:28AM +0100):
> This is what I also want to find out.  One reason can be the recent
> changes to AUCTeX with this commit[1].  Other can be the way you've
> installed AUCTeX and/or configured it.  Therefore my question if you can
> come up with a minimal setup starting with 'emacs -Q'.

Many thanks to you for suggesting this disciplined approach, and edebug for 
helping me locate the problem!

-mandar



Re: problem with cal-tex-cursor-month -> reftex-TeX-master-file -> TeX-master-file

2024-01-24 Thread Arash Esbati
Mandar Mitra  writes:

> 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?

This is what I also want to find out.  One reason can be the recent
changes to AUCTeX with this commit[1].  Other can be the way you've
installed AUCTeX and/or configured it.  Therefore my question if you can
come up with a minimal setup starting with 'emacs -Q'.

I'm using the latest git version directly out of the git repo, no
installation etc. with Emacs 30.0.50 (21e272fe4f).

> 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.
> ---

That seems Ok, it was the way it was done before the change mentioned
above.  Now it looks like this when I open a .tex file:

--8<---cut here---start->8---
The major mode is LaTeX/P mode defined in latex.el:

Major mode in AUCTeX for editing LaTeX files.
See info under AUCTeX for full documentation.

Entering LaTeX mode calls the value of ‘text-mode-hook’,
then the value of ‘TeX-mode-hook’, and then the value
of ‘LaTeX-mode-hook’.
--8<---cut here---end--->8---

Best, Arash

Footnotes:
[1]  
https://git.savannah.gnu.org/cgit/auctex.git/commit/?id=48cc5069988ea1e278f184c236821179e2914a40




Re: problem with cal-tex-cursor-month -> reftex-TeX-master-file -> TeX-master-file

2024-01-24 Thread Mandar Mitra
Arash Esbati wrote (Wed, Jan 24, 2024 at 09:45:17AM +0100):
> Mandar Mitra  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.



Re: problem with cal-tex-cursor-month -> reftex-TeX-master-file -> TeX-master-file

2024-01-24 Thread Arash Esbati
Mandar Mitra  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.

Can you come up with a small recipe starting with emacs -Q?  Maybe that
helps others to reproduce the issue.

Best, Arash