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: Wed, 21 Mar 2018 08:24:31 +0100 Message-ID: <877eq528nk.fsf@mbork.pl> References: <87bmfi0zgb.fsf@mbork.pl> <83bmfhly00.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1521617015 12578 195.159.176.226 (21 Mar 2018 07:23:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Mar 2018 07:23:35 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 21 08:23:30 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 1eyY5n-00036g-FW for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Mar 2018 08:23:27 +0100 Original-Received: from localhost ([::1]:53279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyY7p-0000qC-2M for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Mar 2018 03:25:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyY7O-0000oP-M8 for help-gnu-emacs@gnu.org; Wed, 21 Mar 2018 03:25:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyY7K-0000oq-Ni for help-gnu-emacs@gnu.org; Wed, 21 Mar 2018 03:25:06 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:35635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyY7G-0000nZ-JM; Wed, 21 Mar 2018 03:24:58 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 9E249E676E; Wed, 21 Mar 2018 08:24:57 +0100 (CET) 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 Jj4pEOIrxB0G; Wed, 21 Mar 2018 08:24:53 +0100 (CET) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 720E3E6700; Wed, 21 Mar 2018 08:24:53 +0100 (CET) In-reply-to: <83bmfhly00.fsf@gnu.org> 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:116225 Archived-At: On 2018-03-21, at 07:54, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Date: Wed, 21 Mar 2018 06:28:36 +0100 >> >> I want to insert a string with a part made bold (using >> `add-face-text-property'). In certain buffers (e.g. in Fundamental >> mode) this works, but in some other ones (e.g. in Org-mode or >> message-mode) it does not. After turning font-lock off, it works back >> again. This means that font-lock kicks in right after inserting and >> disables my boldface. > > Yes. > >> Is there a way to make it not happen, without turning font lock off? > > Not really. You can turn off JIT font-lock, but then you will have to > refontify manually, and I suspect that this would, for you, mean > "turning off font-lock". > > Bottom line: in buffers with font-lock turned on, font-lock has > absolute control of the faces. Thanks. This means that instead of inserting stuff with added faces, I need either to modify font lock keywords or use overlays. Best, -- Marcin Borkowski http://mbork.pl