all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Vasilij Schneidermann <mail@vasilij.de>
Cc: 42138@debbugs.gnu.org
Subject: bug#42138: 26.3; Incompatibility between font-lock-add-keywords and enriched.el
Date: Tue, 30 Jun 2020 19:32:48 +0300	[thread overview]
Message-ID: <83d05gzf7z.fsf@gnu.org> (raw)
In-Reply-To: <20200630130822.GE451135@odonien.localdomain> (message from Vasilij Schneidermann on Tue, 30 Jun 2020 15:08:22 +0200)

> Date: Tue, 30 Jun 2020 15:08:22 +0200
> From: Vasilij Schneidermann <mail@vasilij.de>
> 
> 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).





  reply	other threads:[~2020-06-30 16:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 13:08 bug#42138: 26.3; Incompatibility between font-lock-add-keywords and enriched.el Vasilij Schneidermann
2020-06-30 16:32 ` Eli Zaretskii [this message]
2020-07-20  6:59   ` Vasilij Schneidermann
2020-07-20 14:40     ` Eli Zaretskii
2020-07-25 21:37       ` Vasilij Schneidermann
2020-07-26  2:31         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d05gzf7z.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=42138@debbugs.gnu.org \
    --cc=mail@vasilij.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.