From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>,
Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: RE: Font-lock seemingly interacting with insertion
Date: Wed, 21 Mar 2018 17:39:12 -0700 (PDT) [thread overview]
Message-ID: <18a0fded-210a-4c21-b1f1-e7193d7b1110@default> (raw)
In-Reply-To: <87muz1zbez.fsf@web.de>
> > That's a possibility, but it will only work in modes/buffers that turn
> > on font-lock. AFAIU, that was not OP's intent.
>
> I wasn't sure about the actual use case.
>
> 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
next prev parent reply other threads:[~2018-03-22 0:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-21 5:28 Font-lock seemingly interacting with insertion Marcin Borkowski
2018-03-21 6:54 ` Eli Zaretskii
2018-03-21 7:24 ` Marcin Borkowski
2018-03-21 7:47 ` Eli Zaretskii
2018-03-21 9:05 ` Marcin Borkowski
2018-03-21 14:11 ` Michael Heerdegen
2018-03-21 15:24 ` Eli Zaretskii
2018-03-21 15:38 ` Michael Heerdegen
2018-03-21 16:22 ` Eli Zaretskii
2018-03-22 0:39 ` Drew Adams [this message]
2018-03-22 6:53 ` Eli Zaretskii
2018-03-25 17:00 ` Marcin Borkowski
[not found] ` <mailman.11214.1521997256.27995.help-gnu-emacs@gnu.org>
2018-05-15 8:04 ` andlind
2018-03-25 16:55 ` Marcin Borkowski
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18a0fded-210a-4c21-b1f1-e7193d7b1110@default \
--to=drew.adams@oracle.com \
--cc=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).