|
From: | Lennart Borgman (gmail) |
Subject: | Re: how to prevent font-lock from messing with a portion of text? |
Date: | Sat, 24 Mar 2007 02:57:07 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666 |
Drew Adams wrote:
- add a font-lock-fontify-region-function so that after fontifying the region normally, you scan the region for `persistent-face' properties and copy those to the `face' property.Right (ridiculous). Move all of `face' to `persistent-face' and then back again. And besides such a convoluted, heavy workaround?
Maybe just add the wanted face as 'persistent-face, remove 'fontified and then use a function like above? (But I am not sure how to "refontify". Is not turning font-lock-mode off/on a bit heavy? Though that new font-lock-fontify-region-function could be called directly of course. With some twistes then to avoid making the buffer modified.)
A problem with this solution is however that fontification must use font-lock-fontify-region-function etc. All major modes does not do that.
[Prev in Thread] | Current Thread | [Next in Thread] |