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: Mon, 20 Jul 2020 17:40:16 +0300 Message-ID: <83o8oagshb.fsf@gnu.org> References: <20200630130822.GE451135@odonien.localdomain> <83d05gzf7z.fsf@gnu.org> <20200720065931.GA5179@odonien.localdomain> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13058"; 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 Mon Jul 20 16:41:12 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 1jxWyd-0003EZ-17 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Jul 2020 16:41:11 +0200 Original-Received: from localhost ([::1]:55222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jxWyb-0003td-MS for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Jul 2020 10:41:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jxWyU-0003tL-Jb for bug-gnu-emacs@gnu.org; Mon, 20 Jul 2020 10:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52485) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jxWyU-0006Qo-9x for bug-gnu-emacs@gnu.org; Mon, 20 Jul 2020 10:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jxWyT-0000pV-W6 for bug-gnu-emacs@gnu.org; Mon, 20 Jul 2020 10:41: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: Mon, 20 Jul 2020 14:41:01 +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.15952560303144 (code B ref 42138); Mon, 20 Jul 2020 14:41:01 +0000 Original-Received: (at 42138) by debbugs.gnu.org; 20 Jul 2020 14:40:30 +0000 Original-Received: from localhost ([127.0.0.1]:35798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jxWxx-0000oe-U4 for submit@debbugs.gnu.org; Mon, 20 Jul 2020 10:40:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jxWxw-0000oP-0n for 42138@debbugs.gnu.org; Mon, 20 Jul 2020 10:40:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35783) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jxWxq-0006CD-I3; Mon, 20 Jul 2020 10:40:22 -0400 Original-Received: from [176.228.60.248] (port=1342 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jxWxp-0002ok-Sk; Mon, 20 Jul 2020 10:40:22 -0400 In-Reply-To: <20200720065931.GA5179@odonien.localdomain> (message from Vasilij Schneidermann on Mon, 20 Jul 2020 08:59:31 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:183313 Archived-At: > Date: Mon, 20 Jul 2020 08:59:31 +0200 > From: Vasilij Schneidermann > Cc: 42138@debbugs.gnu.org > > > 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. > > Thanks for the clarification. This doesn't really help me though, I want to > adjust my existing font-lock using code so that it detects when it would wipe > out said text properties enriched-mode set up. It doesn't appear to be > sufficient to just check whether `font-lock-mode` is non-nil, if I do that > inside the example enriched.txt file, it's set to `t` for some reason. Again, > what would the correct check be here? I think you want to look at font-lock-defaults. > > 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). > > Hm, I've done that for non-font-lock scenarios before, but in this case I > really need font-lock's ability to search for strings and apply fontification > to them, so this isn't really an option. Looking for other examples in the > Emacs sources I've found uses of `jit-lock-register`. Ah, I guess I misunderstood what kind of solutions you are looking for, sorry. If you want to keep font-lock in effect, then indeed jit-lock-register is one feature to look at. But there are two others: font-lock-extra-managed-props and the font-lock-face property. I hope one of these will allow you to come up with a solution.