From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: how to prevent font-lock from messing with a portion of text? Date: Thu, 22 Mar 2007 12:20:05 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1174591400 3966 80.91.229.12 (22 Mar 2007 19:23:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Mar 2007 19:23:20 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 22 20:23:07 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HUSsL-0003E7-Vx for ged-emacs-devel@m.gmane.org; Thu, 22 Mar 2007 20:23:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUSuA-00054s-Fq for ged-emacs-devel@m.gmane.org; Thu, 22 Mar 2007 14:24:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HUSt6-0004OK-6N for emacs-devel@gnu.org; Thu, 22 Mar 2007 15:23:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HUSt4-0004Np-W7 for emacs-devel@gnu.org; Thu, 22 Mar 2007 15:23:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUSt4-0004Nk-Pk for emacs-devel@gnu.org; Thu, 22 Mar 2007 14:23:50 -0500 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HUSrF-0002M2-9S for emacs-devel@gnu.org; Thu, 22 Mar 2007 15:21:57 -0400 Original-Received: from rgmgw3.us.oracle.com (rgmgw3.us.oracle.com [138.1.186.112]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l2MJLs1o020016 for ; Thu, 22 Mar 2007 14:21:55 -0500 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw3.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l2MHu9nY015285 for ; Thu, 22 Mar 2007 13:21:54 -0600 Original-Received: from dhcp-4op11-4op12-west-130-35-178-179.us.oracle.com by acsmt351.oracle.com with ESMTP id 2555714811174591211; Thu, 22 Mar 2007 12:20:11 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAI= X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68319 Archived-At: > > How can one prevent font-lock from changing the text properties > > of a given portion of text? I tried (put-text-property start end > > 'fontified t), but C-x C-s just re-font-lock fontifies the text > > in question. I also tried binding `inhibit-modification-hooks' > > to t, with the same result. > > There are many different ways, each one with advantages and quirks, > I can't recommend any without knowing more of what you're trying to do, Use put-text-property to add a face to some text using the `face' property. Prevent subsequent "erasure" of that highlighting by font-lock. I would like to be able to, say, set a particular text property on the same text, which would cause font-lock to ignore that text (skip over it, as if it weren't there). I thought that's what property `fontified' (= t) would do, but that seems not to be the case. The Elisp manual says this about `fontified': This property says whether the character has a face assigned to it by font locking. The display engine tests it to decide whether a buffer portion needs refontifying before display. *Note Auto Faces::. It takes one of three values: `nil' Font locking is disabled, or the character's `face' property, if any, is invalid. `defer' This value is only used when "just in time" font locking is enabled and it means that the character's `face' property is invalid and needs deferred fontification. `t' The character's `face' property, or absence of one, is valid.