emacs-devel
[Top][All Lists]
Advanced

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

Re: set-text-properties and jit-lock-mode


From: Eli Zaretskii
Subject: Re: set-text-properties and jit-lock-mode
Date: Sun, 21 Feb 2016 22:30:31 +0200

> From: Alan Schmitt <address@hidden>
> Date: Sun, 21 Feb 2016 19:02:31 +0100
> 
> The problem: if jit-lock-mode it t, then using set-text-properties to
> change the face does not work.
> 
> To reproduce: start emacs with -Q. In the scratch buffer, type "foo".
> Then evaluate:
> (set-text-properties 192 195 (list 'face 'italic))
> 
> Nothing changes, and when I do a `describe-char' on one letter of "foo"
> I don't see the face.
> 
> If I then evaluate
> (setq jit-lock-mode nil)
> (set-text-properties 192 195 (list 'face 'italic))
> 
> then I see the face change to italic, confirmed by `describe-char'.
> 
> As `set-text-properties' is a function in C, I don't know how to look at
> its source (any pointers on how to do this would be great).

You don't need to look at its source.  The documentation clearly says
that it completely replaces the property list of the specified region
with the properties you specify as its arguments.

> Is it supposed not to work for faces when jit-lock is on?

Yes.  Font-lock overwrites the 'face' text properties with its own,
because it uses set-text-properties.



reply via email to

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