help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rainbow-delimiters highlighting { and } for tex and latex


From: Alessandro Bertulli
Subject: Re: Rainbow-delimiters highlighting { and } for tex and latex
Date: Thu, 08 Sep 2022 14:08:37 +0200
User-agent: mu4e 1.8.9; emacs 29.0.50

> Have scrutinised this.  The problem is the atrocious design around the 
> implementation
> of tex and latex major modes.
>
> This will work
>
> (add-to-list 'auto-mode-alist '("\\.sty\\'"   . LaTeX-mode))
> (add-hook 'LaTeX-mode-hook #'rainbow-delimiters-mode)
>
> But this will not
>
> (add-to-list 'auto-mode-alist '("\\.sty\\'"   . latex-mode))
> (add-hook 'latex-mode-hook #'rainbow-delimiters-mode)

I don't want to add more fuel, but just to clear a bit: latex-mode and
tex-mode are the modes set up by vanilla Emacs. AUCTeX, which is an
awesome package to provide a quick yet powerful LaTeX IDE in Emacs,
provides LaTeX-mode and TeX-mode (note the capitalization). Is it
confusing? Unfortunately, yes it is.

> Work needs to be done so that there is just "tex-mode" and "latex-mode",
> and getting rid with all this TeX-mode", "LaTeX-mode",  TeX-mode-hook, 
> LaTeX-mode-hook, nonsense.

I agree, but I guess the point is to not break compatibility with old
codebases. I wonder if defining some aliases would work tho.

> Tools are supposed to work well together but this is not the case with
> "tex-related" modes.

Actually they do, once corrected this thing. Probably you have
auto-mode-alist set up so that .tex/.sty files are opened in LaTeX-mode,
so latex-mode-hook is never actually run. Is this your problem, maybe?
Anyway, I'm glad you got it work.

-- 
Alessandro Bertulli



reply via email to

[Prev in Thread] Current Thread [Next in Thread]