[Top][All Lists]

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

Re: command to fontify whole buffer?

From: Stefan Monnier
Subject: Re: command to fontify whole buffer?
Date: Fri, 23 Sep 2011 00:23:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> Sometimes I want to fontify a whole buffer (really).  One use case is
> to be able to then use the fontification for other (e.g. code)
> purposes than visual highlighting.  But it really doesn't matter why -
> I just want to. ;-)

Agreed.  We need two functions:
- font-lock-flush-region (which marks the region for re-fontification).
- font-lock-ensure-region (which makes sure the region is fontified).
The functions we have were designed before lazy/jit lock and were
adjusted in ad-hoc ways when jit/lazy was added.
For font-lock-ensure-region, you should be able to find sample code for
an implementation in various packages such as ps-print.el and


reply via email to

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