From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: how to prevent font-lock from messing with a portion of text? Date: Mon, 26 Mar 2007 22:26:29 +0900 Message-ID: <87odmgrv96.fsf@catnip.gol.com> References: Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1174915727 20754 80.91.229.12 (26 Mar 2007 13:28:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Mar 2007 13:28:47 +0000 (UTC) Cc: Drew Adams , Emacs-Devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 26 15:28:39 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 1HVpFV-0001Ul-Ob for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2007 15:28:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HVpHk-00052X-ID for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2007 08:30:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HVpFn-00035O-8V for emacs-devel@gnu.org; Mon, 26 Mar 2007 09:28:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HVpFl-00034T-Ko for emacs-devel@gnu.org; Mon, 26 Mar 2007 09:28:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HVpFl-00034C-DX for emacs-devel@gnu.org; Mon, 26 Mar 2007 08:28:53 -0500 Original-Received: from smtp02.dentaku.gol.com ([203.216.5.72]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HVpDU-0000gY-NK; Mon, 26 Mar 2007 09:26:33 -0400 Original-Received: from 203-216-100-100.dsl.gol.ne.jp ([203.216.100.100] helo=catnip.gol.com) by smtp02.dentaku.gol.com with esmtpa (Dentaku) id 1HVpDR-0002QH-SP; Mon, 26 Mar 2007 22:26:29 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id 964A42F43; Mon, 26 Mar 2007 22:26:29 +0900 (JST) System-Type: i686-pc-linux-gnu In-Reply-To: (Stefan Monnier's message of "Mon\, 26 Mar 2007 09\:01\:04 -0400") Original-Lines: 18 X-Abuse-Complaints: abuse@gol.com X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:68599 Archived-At: Stefan Monnier writes: > OK, here's another option: don't change anything to font-lock, don't fiddle > with it at all, just don't use text-properties to add your special faces. > Use overlays instead. Typical "highlighter" applications seem a bit more suited to overlays anyway (e.g., if I copy the text, I don't really expect the highlighting to come along...). I suppose if there's some reason to use text-properties, "hi-lock.el" (in the distribution) could be used as an example of one way to do that. [It actually _uses_ font-lock to do the highlighting which seems fairly clever -- e.g., if you type more text after having highlighted a phrase, the phrase gets automagically highlighted in the new text too!] -Miles -- Yo mama's so fat when she gets on an elevator it HAS to go down.