Heime <[email protected]> writes:

>> > How can I ovorcome this problem, so I can propertize my text in a org-mode
>> > buffer?
>> 
>> This is expected in all the major modes in Emacs that use
>> font-lock-mode.
>> Check out 16.13 Font Lock mode section of Emacs manual.
>
> Would maintainers suggest incorporating custom modifications 
> into the rules that font-lock uses?

Maybe. Or not. Depends on what you want.
The fundamental problem you encounter is that font-lock-mode is not
designed to keep faces intact. The idea behind font-lock is that faces
are computed dynamically, and recomputed as you modify the buffer.

If you want to make sure that certain phrases (even multiple instances)
are always highlighted, font-lock is a reasonable choice. If you just
want a one-off highlight, you'd better use overlay.
  
>> Consider hi-lock-mode.
>
> Your suggestion worked well.  As this is similar to 
> using overlays, when does one recommend one over the 
> other?

hi-lock-mode is simply an easier (interactive) way to add font-lock
rules. Overlays are independent of font-lock, and may actually be more
suitable (depending on what you want). You can put a single overlay with
'face property on a specific range in your buffer and that will not be
touched by font-lock. But that overlay will not auto-apply in indirect
buffers or in similar phrases.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to