From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: how to prevent font-lock from messing with a portion of text? Date: Thu, 22 Mar 2007 22:40:08 +0100 Message-ID: <4602F7B8.5050204@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1174599627 2268 80.91.229.12 (22 Mar 2007 21:40:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Mar 2007 21:40:27 +0000 (UTC) Cc: Emacs-Devel To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 22 22:40:21 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 1HUV19-0002TN-55 for ged-emacs-devel@m.gmane.org; Thu, 22 Mar 2007 22:40:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUV2y-0000sv-CC for ged-emacs-devel@m.gmane.org; Thu, 22 Mar 2007 16:42:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HUV2u-0000m3-8J for emacs-devel@gnu.org; Thu, 22 Mar 2007 17:42:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HUV2s-0000gM-Cu for emacs-devel@gnu.org; Thu, 22 Mar 2007 17:42:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUV2s-0000g9-9v for emacs-devel@gnu.org; Thu, 22 Mar 2007 16:42:06 -0500 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HUV12-0006Cc-55 for emacs-devel@gnu.org; Thu, 22 Mar 2007 17:40:12 -0400 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:65099 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1HUV0z-0006mj-4n; Thu, 22 Mar 2007 22:40:10 +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 In-Reply-To: X-Antivirus: avast! (VPS 000727-0, 2007-03-22), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1HUV0z-0006mj-4n. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1HUV0z-0006mj-4n 3340575e707d6a5fdef59c5d6d7b8109 X-detected-kernel: Linux 2.6? (barebone, rare!) 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:68331 Archived-At: Drew Adams wrote: >> Did you try using something like the defmacro `save-buffer-state' that >> you can find in font-lock.el? > > I don't see the connection. It was merely a guess from my side. I thought that something in the fontification framework was started by the changes you made when you set the face. Maybe I am also misunderstanding what you are trying to do. However I tried this: - emacs -Q - I opened a html file. - M-x html-mode - Did some small changes to modify the buffer - Then I called the function below (defun test-mode-face() (interactive) (my-save-buffer-state nil (put-text-property 5 15 'face 'highlight))) Now the buffer had the face above from 5 - 15. Then I did C-x C-s. That face remained. If I remove my-save-buffer-state above I never see that highlight face.