From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: font lock woes Date: 5 Mar 2013 18:07:38 GMT Message-ID: References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1362528538 17848 80.91.229.3 (6 Mar 2013 00:08:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Mar 2013 00:08:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 06 01:09:22 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UD1v7-0008UC-JY for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Mar 2013 01:09:21 +0100 Original-Received: from localhost ([::1]:52796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UD1ul-0004lc-Ss for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Mar 2013 19:08:59 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-X-Trace: individual.net bbuj+ZQJCDO0ydFFr3GY4ARTwzSFBFPsB3KEVKqYU4lOk0n+K8X/z+J55J5eD57F50 Cancel-Lock: sha1:cdmiGrLcSdlB+bHEcq43DAxBBVM= Mail-Copies-To: nobody X-Editor: Emacs of course! User-Agent: slrn/pre1.0.0-18 (Linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:197087 X-Mailman-Approved-At: Tue, 05 Mar 2013 19:08:47 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89373 Archived-At: Stefan Monnier wrote: >> Yes, I have, and the matchers are there, but the relevant strings do not >> get fontified: cm-addition-face (which is just a foreground color) isn't >> applied and matching text is not read-only. > > Could it be that the relevant strings already have some other face? No, the relevant strings don't have another face. Before I tried adding the read-only property, I just had: ,---- | (font-lock-add-keywords nil `((,(regexp-quote "{++") . cm-addition-face)) t) `---- and that worked fine. Changing that line to ,---- | (font-lock-add-keywords nil `((,(regexp-quote "{++") . '(face cm-addition-face read-only t))) t) `---- made fontification of the relevant strings stop working. After changing it to: ,---- | (font-lock-add-keywords nil `((,(regexp-quote "{++") 0 '(face cm-addition-face read-only t)) `---- fontification worked again. >> visible part of the buffer, the call to font-lock-fontify-buffer above >> removes the font-lock-face property but not the read-only property. > > No, the call itself does not, it only schedules the buffer for > refontification, i.e. the font-lock-face is only removed (in the visible > part) during the next redisplay, at which point you've already removed > `read-only' from font-lock-extra-managed-props. Ah, ok, it makes sense now. Thanks for the explanation. -- Joost Kremers joostkremers@fastmail.fm Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)