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

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

Re: tex-mode.el


From: Christopher Dimech
Subject: Re: tex-mode.el
Date: Thu, 11 Feb 2021 05:01:08 +0100

When I used "tex-mode.el", the suscript fontification can be disabled
using the following function.  But does not work with my minor-mode.

(defun supinf-disable ()
   (interactive)
   (setq-local tex-fontify-script nil)
   (font-lock-flush))

I am trying to have two functions, one to enable, another
to disable.  Enabling is also creating me problems to set up.
The code in tex-mode.el is in quite a mess and surely does not
help a lot.

> Sent: Thursday, February 11, 2021 at 3:42 PM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: help-gnu-emacs@gnu.org
> Subject: Re: tex-mode.el
>
> Christopher,
>
> After commenting out the `multic' expression I could try your example.
>
> I'm not really skilled with font-lock.
>
> I think in your case `font-lock-flush' is indeed not enough, I think
> that one doesn't unfontify, which has to be done in your case.
> `font-lock-refresh-defaults' as had been suggested should be better.
>
> Your unfontify function seems to work when called (tested).  But is it
> called?
>
> I think here:
>
> (defun supinf-disable ()
>   "Disable the supinf typeface"
>   (font-lock-flush (point-min) (point-max))
>   (setq font-lock-defaults
>       '(font-lock-unfontify-region-function . supinf-disable-cruc))
>         ^^^^
>   ;;(supinf-disable-cruc (point-min) (point-max))
>   (font-lock-flush (point-min) (point-max)) )

Yes, it was a bad attempt from my part.  It was the routine hack I was
playing with.

> you are missing a level of parens.  Then, with some good will, the thing
> could indeed work I think.
>
> Oh, and it seems something in your mode is not done buffer locally,
> since the ^^^^ underlining here now looks weird in my messages buffer,
> where I definitely didn't enable your mode.  Or maybe just a side effect
> of experimenting, dunno.
>
> HTH,
>
> Michael.
>
>
>



reply via email to

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