help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Font-lock seemingly interacting with insertion


From: Marcin Borkowski
Subject: Re: Font-lock seemingly interacting with insertion
Date: Sun, 25 Mar 2018 19:00:24 +0200
User-agent: mu4e 1.1.0; emacs 27.0.50

On 2018-03-22, at 01:39, Drew Adams <drew.adams@oracle.com> wrote:

>> > 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'.

font-lock-face won't work, but for different reasons.  As I mentioned in
my previous message, I'll report back (in fact, I'll blog about it some
day) when the issue is solved.  Most probably, I will have to use
overlays.

> 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).

That is interesting - I even have that library because of
`hlt-highlight-region' - but in this case I don't want any
dependencies.  But thanks anyway!

> 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'.

Interesting, but again - external library.

Thanks,

-- 
Marcin Borkowski
http://mbork.pl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]