From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.devel Subject: Re: feature request: text property to prevent font-locking Date: Sun, 31 Aug 2014 16:31:48 +0200 Message-ID: <8538cc4sv7.fsf@iznogoud.viz> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1409496571 10943 80.91.229.3 (31 Aug 2014 14:49:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Aug 2014 14:49:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 31 16:49:23 2014 Return-path: Envelope-to: ged-emacs-devel@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 1XO6RX-0006l6-7d for ged-emacs-devel@m.gmane.org; Sun, 31 Aug 2014 16:49:23 +0200 Original-Received: from localhost ([::1]:50061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XO6RW-0008M6-TQ for ged-emacs-devel@m.gmane.org; Sun, 31 Aug 2014 10:49:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XO6RN-0008KI-5S for emacs-devel@gnu.org; Sun, 31 Aug 2014 10:49:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XO6RF-0003Ig-Mi for emacs-devel@gnu.org; Sun, 31 Aug 2014 10:49:13 -0400 Original-Received: from b2bfep16.mx.upcmail.net ([62.179.121.61]:53479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XO6RF-0003IW-BB for emacs-devel@gnu.org; Sun, 31 Aug 2014 10:49:05 -0400 Original-Received: from edge12.upcmail.net ([192.168.13.82]) by b2bfep16-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20140831144901.EXPS9452.b2bfep16-int.chello.at@edge12.upcmail.net> for ; Sun, 31 Aug 2014 16:49:01 +0200 Original-Received: from iznogoud.viz ([91.119.88.190]) by edge12.upcmail.net with edge id lSp11o00C46QafP0CSp1Gc; Sun, 31 Aug 2014 16:49:01 +0200 X-SourceIP: 91.119.88.190 Original-Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XO6RA-0000Qp-W3; Sun, 31 Aug 2014 16:49:01 +0200 Mail-Followup-To: Drew Adams , emacs-devel@gnu.org User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (berkeley-unix) X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 62.179.121.61 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173921 Archived-At: On Thu, Aug 28 2014, Drew Adams wrote: > I want to apply some ad-hoc highlighting with text property `face' > in a font-locked buffer (whether font-locking occurs before or after > I apply `face' for this highlighting). > I do not want font-lock to override this highlighting. I do not want > to use `font-lock-keywords' (e.g. with KEEP) in order to create this > highlighting. I just want to prevent font-lock from overriding it. So, let me try to understand the extent of the problem. font-lock-default-unfontify-region leaves alone any "alternative" (defined in char-property-alias-alist) of the `face' text property. In particular, this is how the font-lock-face text property works. Now, on the one hand, keyword fontification does not override "alternatives" (except if the highlight pattern has an `override' flag). This is because text-property-not-all recognizes them and thus prevents font-lock-apply-highlight from adding a value for the `face' property. On the other hand, some experimenting suggests that syntactic fontification does override those "alternatives". > I want to apply some other text property to the highlighted text, > to tell font-lock not to fiddle with it ("hands off this text"). Remove it from the value of `font-lock-extra-managed-props'. tl; dr: Existing facilities reduce the problem to clashes with syntactic fontification. Wolfgang