auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] (add-hook 'LaTeX-mode-hook 'turn-on-prettify-symbols-


From: Tassilo Horn
Subject: Re: [AUCTeX-devel] (add-hook 'LaTeX-mode-hook 'turn-on-prettify-symbols-mode)
Date: Wed, 02 Sep 2015 14:41:31 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Uwe Brauer <address@hidden> writes:

>    > I just wanted do debug this issue but with the Emacs copy as of right
>    > now (commit 4a703c73305211c780307e3654969ac1a20fb229) I can't reproduce
>    > it anymore.  With the above add-hook, symbols are instantly prettified
>    > when opening some tex file.
>
>    > So it might be some temporary hiccup in emacs.  Can you confirm that?
>
> [snip]
>
> This worked but the hook problem continues.

Indeed, now I can also reproduce it.  I think the problem is that
font-latex.el adds `font-latex-setup' to `latex-mode-hook' for users of
the standard Emacs `latex-mode' that want to use font-latex.  The
problem is that `latex-mode-hook' is also run when using AUCTeX LaTeX
mode, and `font-latex-setup' completely re-initializes font-lock rules
and throws prettify-symbol's rule out.

I see several ways to fix this:

1. Remove `font-latex-setup' from `latex-mode-hook' in
   `VirTeX-common-initialization'.  I mean, then we know that the user
   uses AUCTeX's modes and not the built-in ones.

2. Don't add `font-latex-setup' to `latex-mode-hook' when loading
   font-latex.el in the first place.

IMO, fix 2 is better because modifying stuff just by loading a lisp file
is bad practice anyway.  However, it will break for users of the Emacs
built-in (la)tex-mode who use font-latex.  They'd have to place
`font-latex-setup' in their `latex-mode-hook' on their own then.

Bye,
Tassilo



reply via email to

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