[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: command to fontify whole buffer?
From: |
Jambunathan K |
Subject: |
Re: command to fontify whole buffer? |
Date: |
Fri, 23 Sep 2011 10:25:55 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt) |
Stefan Monnier <address@hidden> writes:
>> 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
> replace.el.
In htmlfontify.el (htmlfontify-buffer), hfy-force-fontification calls
either font-lock-fontify-region (in interactive mode) or
font-lock-fontify-buffer (in non-interactive mode).
The latter funcion in turn calls font-lock-fontify-buffer-function which
apparently points to jit-lock-refontify.
I hope either the htmlfontify-buffer DTRT or it may fail to re-fontify
under certain circumstances.
> Stefan
>
>
--
- Re: command to fontify whole buffer?, (continued)
RE: command to fontify whole buffer?, Drew Adams, 2011/09/22
Re: command to fontify whole buffer?, Stefan Monnier, 2011/09/23
- Re: command to fontify whole buffer?,
Jambunathan K <=