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: Christopher Dimech
Subject: Re: Rainbow-delimiters highlighting { and } for tex and latex
Date: Thu, 8 Sep 2022 15:25:23 +0200

> Sent: Friday, September 09, 2022 at 12:08 AM
> From: "Alessandro Bertulli" <alessandro.bertulli96@gmail.com>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "Stefan Monnier" <monnier@iro.umontreal.ca>, wilnerthomas@tutanota.com, 
> help-gnu-emacs@gnu.org
> Subject: Re: Rainbow-delimiters highlighting { and } for tex and latex
>
>
> > 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.

The plan would be to integrate the functionality of AUCTeX into tex-mode
and latex-mode, even though there can be a core AUCTeX file.  The problems
associated with the separate functionality has been discussed with Carsten
Dominik about his "cdlatex" rapid tools.  There is agreement on the need
for thinking a new scheme through.

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

I would say that users expect emacs to honour the contents of auto-mode-alist.

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

There is a solution but is very time consuming to realise what is happening.
Especially for users who rely on many tools and packages.




reply via email to

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