[Top][All Lists]

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

RE: command to fontify whole buffer?

From: Drew Adams
Subject: RE: command to fontify whole buffer?
Date: Thu, 22 Sep 2011 07:56:52 -0700

> > `font-lock-fontify-buffer' doesn't do it.
> Are you sure?  I thought it did, and looking again at the 
> fine source, it does appear to.

No, I only think I'm sure. ;-)

After calling `font-lock-fontify-buffer', I can search for zones with face
`font-lock-function-name-face', for example, and I can see that there are no
such zones after some minimal portion of the buffer.

> > Marking the whole buffer and using 
> `(font-lock-fontify-region BEG END)'
> > doesn't do it.
> Ditto.


> > Digging more than a bit, I finally found non-interactive function
> > `jit-lock-fontify-now', which seems to do the trick.  Why 
> > not provide a command that does it?
> jit-lock-fontify-now                 just calls the function
> font-lock-fontify-region             (via a hook) which calls
> font-lock-default-fontify-region     (via another hook).

I believe you, but I'm not seeing `font-lock-default-fontify-region' fontify
everything.  I'm no expert on this at all.  Just going by what I think I see.

> Surely 'fontified DOES do it.  If it has the value t throughout the
> buffer, that buffer is fully fontified, otherwise not.

Perhaps you're right that if I checked that property throughout the entire
buffer it would be sufficient.  Dunno.  I probably didn't try testing it
everywhere.  But if that's the best test for full-buffer fontification then I
would still prefer something simpler/quicker.

> Or have I misunderstood something?

No, no doubt I have.  No doubt I still do. ;-)

> By the way, I drew a diagram of how jit-lock works about 5 years ago,
> tracing the functions which call each other, and the hooks 
> out of which things get hoiked.  Would you be interested in a copy of it?

I guess so; thanks.  But I would mostly be interested in confirmation that you
are right etc.  I do not see (e.g. by searching for property zones) that the
entire buffer gets fontified by `font-lock-fontify-buffer', but you say it

reply via email to

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