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

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

Re: When are the face text properties actually set?


From: jack-mac
Subject: Re: When are the face text properties actually set?
Date: Thu, 14 Jun 2012 00:43:06 -0700 (PDT)
User-agent: G2/1.0

Thanks a lot, Stefan, for your precious answers!

On 13 juin, 17:18, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> It's normal: this is handled by jit-lock which adds the property on the
> fly before a chunk of text is displayed.

I did not know the jit-lock system!
When I do "ema
Can you tell me why, when

>
> > If it's normal, is there any way to force the text properties to be
> > set the way they will be set when the point is displayed?
>
> Yes, you can use something like jit-lock-fontify-now.



>
> > I mean: I just want (get-text-property 2400 'face) to return the text
> > property whether it has already been displayed or not!
> > I tried the following which works more or less:
> >         M-: (progn (goto-char 2400) (sit-for 0) (get-text-property
> > 2400 'face))
> >         => font-lock-comment-face
>
> Rather than check the `face' property for `font-lock-comment-face' you
> should check the output of (syntax-ppss), which also has the advantage
> of not depending on highlighting (so you don't need to fiddle with
> jit-lock or worry about those users who disable font-lock).
>
>         Stefan



reply via email to

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