From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#42138: 26.3; Incompatibility between font-lock-add-keywords and enriched.el Date: Tue, 30 Jun 2020 19:32:48 +0300 Message-ID: <83d05gzf7z.fsf@gnu.org> References: <20200630130822.GE451135@odonien.localdomain> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28307"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42138@debbugs.gnu.org To: Vasilij Schneidermann Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 30 18:53:18 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jqJDM-000ABs-6v for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jun 2020 18:34:32 +0200 Original-Received: from localhost ([::1]:58018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqJDK-000617-Kj for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jun 2020 12:34:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqJCx-00060M-Gk for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 12:34:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jqJCs-0005fl-BV for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 12:34:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jqJCs-0008Di-75 for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 12:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jun 2020 16:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42138 X-GNU-PR-Package: emacs Original-Received: via spool by 42138-submit@debbugs.gnu.org id=B42138.159353478431530 (code B ref 42138); Tue, 30 Jun 2020 16:34:02 +0000 Original-Received: (at 42138) by debbugs.gnu.org; 30 Jun 2020 16:33:04 +0000 Original-Received: from localhost ([127.0.0.1]:51547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqJBw-0008CT-0h for submit@debbugs.gnu.org; Tue, 30 Jun 2020 12:33:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqJBt-0008Bx-Jo for 42138@debbugs.gnu.org; Tue, 30 Jun 2020 12:33:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52507) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqJBn-0005bP-QV; Tue, 30 Jun 2020 12:32:55 -0400 Original-Received: from [176.228.60.248] (port=4371 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jqJBn-0005f4-A7; Tue, 30 Jun 2020 12:32:55 -0400 In-Reply-To: <20200630130822.GE451135@odonien.localdomain> (message from Vasilij Schneidermann on Tue, 30 Jun 2020 15:08:22 +0200) X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:182577 Archived-At: > Date: Tue, 30 Jun 2020 15:08:22 +0200 > From: Vasilij Schneidermann > > After opening enriched.txt and running any kind of code using the > `font-lock-add-keywords` function (for example whitespace-mode or > hl-todo-mode), the enriched highlighting is gone. Is this a bug or > intentional? If it's intentional, is there some way for the code using > `font-lock-add-keywords` to detect this condition, other than checking > for the presence of enriched-mode? I think enriched-mode, like any other mode that puts its own faces on chunks of text by means other than font-lock, is fundamentally incompatible with font-lock. It's basically the same problem as if you tried to use put-text-property in *scratch* to put some face property on some text in the buffer: the face won't show until you turn off font-lock. That's because the first thing font-lock does is wipe out all the faces in the buffer. > Alternatively, is there a recommended way to add highlighting of > keywords that's compatible with enriched-mode? Any way that uses put-text-property, add-text-properties, etc. without using font-lock will do. You can even try that manually via the facemenu-set-* commands (or via the Edit->Text Properties menu from the menu bar).