From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Font-lock seemingly interacting with insertion Date: Wed, 21 Mar 2018 17:39:12 -0700 (PDT) Message-ID: <18a0fded-210a-4c21-b1f1-e7193d7b1110@default> References: <87bmfi0zgb.fsf@mbork.pl> <83bmfhly00.fsf@gnu.org> <87d0zx8qmy.fsf@web.de> <83tvt9jvsv.fsf@gnu.org> <87muz1zbez.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1521679073 7439 195.159.176.226 (22 Mar 2018 00:37:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 22 Mar 2018 00:37:53 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen , Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 22 01:37:49 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 1eyoEn-0001q2-6K for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Mar 2018 01:37:49 +0100 Original-Received: from localhost ([::1]:58240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyoGo-0007FR-SO for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Mar 2018 20:39:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyoGI-0007FH-O0 for help-gnu-emacs@gnu.org; Wed, 21 Mar 2018 20:39:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyoGH-00035k-J5 for help-gnu-emacs@gnu.org; Wed, 21 Mar 2018 20:39:22 -0400 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:59668) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eyoGD-000313-BJ; Wed, 21 Mar 2018 20:39:17 -0400 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2M0bcAd139320; Thu, 22 Mar 2018 00:39:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=LWxQvbzBSDe4R7qnehgDqGKlg8HnEv852Csz0mnnNZg=; b=TqI2WtvHrs4q0WgMgeoj71r0bXrg3S5exo10Mlng71ztoH3tCvw568Z7vpBrMKRAIRbr sskV5iJObxJJUOTGHObhAPgUuL7NM+KkntwkfrV4JDSPj/My4nsSmyWrTtHRMZV4FoWu 1Hf/aNSbjXNO0V3Dz78ENobRuC3IVrUXMOx44yinx2oCTbqylrzmNMnj+4CFBd6/13Oo gT1lH9O4p/hUTyB1GS0Y1Ff+/OJzmpjZqs/8lyD1UR/w4S0kZF0rca1pdD33HbukQp0L trNJaFoLLQ4Z3R7U0WLQUMl7n2FKdwFKfloei+lV4hunaTa5A5itTV7Xyl0EmaPb2Vpu IQ== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2gv23rg03h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Mar 2018 00:39:15 +0000 Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2M0dEbA020610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Mar 2018 00:39:14 GMT Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2M0dDvK016549; Thu, 22 Mar 2018 00:39:14 GMT In-Reply-To: <87muz1zbez.fsf@web.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4666.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8839 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=995 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803200127 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 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:116255 Archived-At: > > That's a possibility, but it will only work in modes/buffers that turn > > on font-lock. AFAIU, that was not OP's intent. >=20 > I wasn't sure about the actual use case. >=20 > 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'. That text property just gives font-lock more control, not less. And `hi-lock.el' just uses font-lock to do its job, so it too is no escape from control by font-lock-mode. 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). 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'. See: https://www.emacswiki.org/emacs/HighlightLibrary See also this Emacs Dev discussion: http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00540.html http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00583.html