From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: Font-lock seemingly interacting with insertion Date: Sun, 25 Mar 2018 19:00:24 +0200 Message-ID: <87k1u0145z.fsf@mbork.pl> References: <87bmfi0zgb.fsf@mbork.pl> <83bmfhly00.fsf@gnu.org> <87d0zx8qmy.fsf@web.de> <83tvt9jvsv.fsf@gnu.org> <87muz1zbez.fsf@web.de> <18a0fded-210a-4c21-b1f1-e7193d7b1110@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1521997160 27342 195.159.176.226 (25 Mar 2018 16:59:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Mar 2018 16:59:20 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: Michael Heerdegen , help-gnu-emacs@gnu.org To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 25 18:59:15 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f08zD-00071V-Aw for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Mar 2018 18:59:15 +0200 Original-Received: from localhost ([::1]:51945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f091G-0000uJ-O3 for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Mar 2018 13:01:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f090o-0000u7-Fs for help-gnu-emacs@gnu.org; Sun, 25 Mar 2018 13:00:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f090n-0004UB-JJ for help-gnu-emacs@gnu.org; Sun, 25 Mar 2018 13:00:54 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:52597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f090k-0004P6-DU; Sun, 25 Mar 2018 13:00:50 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 9CAE1E69DC; Sun, 25 Mar 2018 19:00:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HsTVL8tDd7tw; Sun, 25 Mar 2018 19:00:47 +0200 (CEST) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id D91C9E6700; Sun, 25 Mar 2018 19:00:46 +0200 (CEST) In-reply-to: <18a0fded-210a-4c21-b1f1-e7193d7b1110@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.110.48.8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:116275 Archived-At: On 2018-03-22, at 01:39, Drew Adams wrote: >> > That's a possibility, but it will only work in modes/buffers that turn >> > on font-lock. AFAIU, that was not OP's intent. >> >> I wasn't sure about the actual use case. >> >> If it should work for both font-lock on and off, would it make sense to >> add both a face and a font-lock-face property to the string to be >> inserted? > > I haven't followed this, so the use case is not clear to me. > > But if the OP wants highlighting that will be present whether > font-locking is on or off then font-lock is not the answer (!), > including its use of `font-lock-face'. font-lock-face won't work, but for different reasons. As I mentioned in my previous message, I'll report back (in fact, I'll blog about it some day) when the issue is solved. Most probably, I will have to use overlays. > If you want highlighting that is independent of font-lock then > you might give library `highlight.el' a try. It lets you > highlight using text properties or overlay properties, and the > highlighting can be independent of font-lock (or not - au choix). That is interesting - I even have that library because of `hlt-highlight-region' - but in this case I don't want any dependencies. But thanks anyway! > If you want to be able to tell font-lock "hands off", i.e., to > ignore particular text, you can alternatively use text property > `font-lock-ignore'. For that, see library `font-lock+.el'. Interesting, but again - external library. Thanks, -- Marcin Borkowski http://mbork.pl