emacs-devel
[Top][All Lists]
Advanced

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

Re: Question: add-face-text-property for 'font-lock-face?


From: Qiantan Hong
Subject: Re: Question: add-face-text-property for 'font-lock-face?
Date: Sun, 29 Aug 2021 04:47:11 +0000

I think in reality, probably not that many overlays are strictly required,
because each collaborators tend to author in consecutive chunks.
However it does require some more implementation effort to make it work,
because we need to color code every newly inserted text based on
its author. The naive way that create an overlay for each character
clearly doesn’t work (text property however works, because Emacs itself
always merge them). We would need to look at overlays around the insertion
point and opportunistically merge them.

I feel like using text property will be cleaner, but let’s see if there’s a 
right way.


> On Aug 28, 2021, at 9:39 PM, Yuan Fu <casouri@gmail.com> wrote:
> 
> 
> 
>> On Aug 28, 2021, at 9:36 PM, Qiantan Hong <qhong@mit.edu> wrote:
>> 
>> That’s an option, but I’m worried about performance because 
>> crdt-visuallize-author-mode
>> need to color code the whole document and that might be too many overlays.
>> Maybe one can lazily create overlay for visible part only but I feel like
>> at that point I’ll probably just reinvent an adhoc 
>> add-font-lock-face-text-property in Elisp.
> 
> I don’t think you need to worry about performance beofore there are thousands 
> of overlays. Will there be that many?
> 
> Yuan


reply via email to

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