auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] latex-pretty-symbols.el and subscripts (x-symbol): do


From: Tassilo Horn
Subject: Re: [AUCTeX-devel] latex-pretty-symbols.el and subscripts (x-symbol): don't display _ or ^
Date: Tue, 25 Aug 2015 10:45:26 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Uwe Brauer <address@hidden> writes:

Hi Uwe,

>    > Not exactly sure what you mean, but when you write \alpha the greek
>    > letter will be displayed, and when you then continue writing quux so
>    > that it becomes \alphaquux, it will be displayed "normally" again
>    > (assuming that you didn't define a pretty char for \alphaquux, of
>    > course).
>
> What I mean is this:
>
>     -  when I use x-symbol-mode (a minor mode) typing \alpha gives  α.
>        Lets call this prettifying.  
>
>     -  when I turn x-symbol-mode off,   α is displayed again as \alpha.
>        Lets call this un-prettifying.
>
>
> latex-pretty-symbols.el which I found in the net is neither a minor
> mode nor does it provide a un-prettifying function.
>
> Now your implementation seems also not to be a minor mode the question
> I wanted to ask is, does it provide a un-prettifying function?

Enabling `prettify-symbols-mode' adds a font-lock rule which will
compose symbols into one single unicode character, and disabling the
mode removes this font-lock rule again.  So by toggling
`prettify-symbols-mode', you can switch between pretty/un-pretty.  What
you can't do is (un-)prettifying just one occurrence.

>    > You could try adding the lambda which is added to
>    > `TeX-after-insert-macro-hook' by `TeX-fold-mode' to the buffer
>    > local value of `post-command-hook'.  Maybe that gives you some
>    > as-you-type folding.
>
> Ok I thought about this hook and I fiddled around with
> post-command-hook some time ago in a different context. In my
> experience this hook leads to performance problems.

Yes, it is run after every command that has been executed so you don't
want to have something expensive in there.  If the try-folding function
is too expensive is something you have to determine by trying it out.

Bye,
Tassilo



reply via email to

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