From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: How to prevent font-lock (& jit-lock etc.) from refontifying? Date: Wed, 13 Oct 2004 21:20:05 GMT Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1097702581 4160 80.91.229.6 (13 Oct 2004 21:23:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Oct 2004 21:23:01 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 13 23:22:57 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CHqaG-0004M3-00 for ; Wed, 13 Oct 2004 23:22:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CHqhK-0006KM-0v for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Oct 2004 17:30:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!HSNX.atgi.net!newsfeed.sjc.globix.net!cyclone-sf.pbi.net!216.196.98.144!border2.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!207.35.177.252!nf3.bellglobal.com!snoopy.risq.qc.ca!charlie.risq.qc.ca!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:+85F4Jjk69iyfGo+Ssut9Z+Wt3k= Original-Lines: 22 Original-NNTP-Posting-Host: 132.204.24.84 Original-X-Complaints-To: abuse@umontreal.ca Original-X-Trace: charlie.risq.qc.ca 1097702405 132.204.24.84 (Wed, 13 Oct 2004 17:20:05 EDT) Original-NNTP-Posting-Date: Wed, 13 Oct 2004 17:20:05 EDT Original-Xref: shelby.stanford.edu gnu.emacs.help:125869 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:21238 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21238 > In Emacs 20, I only had to worry about lazy-lock doing this, and function > lazy-lock-after-fontify-buffer was available to convince lazy-lock not to > undo things behind my back. I could just call that function after > highlighting, to fool lazy-lock into thinking there was no need to > rehighlight. This function, lock-after-fontify-buffer, is still available in > Emacs 21. Such a hack will not prevent future re-highlighting (e.g. if you later on make a change on the same line). If that's good enough, then just do: (let ((inhibit-modification-hooks t)) (put-text-property start end 'face 'toto)) > Please don't reply that I should just use font-lock-keywords and let > font-lock do the highlighting. Assume that there is a reason I want to add > some-face as the 'face property using put-text-property. Thanks. Without knowing the reason why you want to do it, I can't give you a good answer. Stefan