From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: feature request: text property to prevent font-locking Date: Sat, 30 Aug 2014 09:27:01 +0000 Message-ID: <20140830092701.GA3351@acm.acm> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1409391568 26426 80.91.229.3 (30 Aug 2014 09:39:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 Aug 2014 09:39:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 30 11:39:21 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 1XNf7w-0002VU-5x for ged-emacs-devel@m.gmane.org; Sat, 30 Aug 2014 11:39:20 +0200 Original-Received: from localhost ([::1]:45822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNf7v-0001uC-QK for ged-emacs-devel@m.gmane.org; Sat, 30 Aug 2014 05:39:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNf7m-0001sh-G1 for emacs-devel@gnu.org; Sat, 30 Aug 2014 05:39:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNf7c-0003Pw-PL for emacs-devel@gnu.org; Sat, 30 Aug 2014 05:39:10 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:33112 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNf7c-0003PW-GB for emacs-devel@gnu.org; Sat, 30 Aug 2014 05:39:00 -0400 Original-Received: (qmail 44244 invoked by uid 3782); 30 Aug 2014 09:32:14 -0000 Original-Received: from acm.muc.de (pD951992C.dip0.t-ipconnect.de [217.81.153.44]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 30 Aug 2014 11:32:13 +0200 Original-Received: (qmail 3387 invoked by uid 1000); 30 Aug 2014 09:27:01 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 193.149.48.1 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:173901 Archived-At: Hi, Drew. On Thu, Aug 28, 2014 at 02:18:28PM -0700, Drew Adams wrote: > Excuse me if I'm missing something that is already available. > And in that case, please let me know what it is, so I can use it. > 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. > 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"). > 1. Does this possibility already exist in Emacs? I looked but didn't > find anything. > 2. If not, can we please add it? [ .... ] For this particular application of fontifying, you might be able to use overlays, which take priority over text properties (see page "Overlay Properties" in the Elisp manual). You might have to define a lot of attributes for the overlay face to prevent attributes from font-locking "showing through". That feels like a bit of a kludge, though. The facility you've sketched out (and implemented) might well be a useful one. -- Alan Mackenzie (Nuremberg, Germany).