unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Qiantan Hong <qhong@mit.edu>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "cpitclaudel@gmail.com" <cpitclaudel@gmail.com>,
	Eli Zaretskii <eliz@gnu.org>, Emacs Devel <emacs-devel@gnu.org>
Subject: Re: Question: add-face-text-property for 'font-lock-face?
Date: Mon, 30 Aug 2021 00:41:15 +0000	[thread overview]
Message-ID: <BF152765-F534-4AF8-B8BA-EBC9413E8AA6@mit.edu> (raw)
In-Reply-To: <jwv5yvnhl27.fsf-monnier+emacs@gnu.org>

> IIRC we have pretty much exactly that need in outline.el where we use
> overlays to put an `invisible` property.  See `outline-flag-region`.
> AFAICT this code currently doesn't try and merge overlays upon
> insertion, but it shouldn't be hard to add that functionality.
It seems that outline.el always call outline-flag-region on chunk of texts
(an entry, a subtree, etc). On the other hand crdt.el need to add property
to every modification received from remote peer, lots of them will contain
only single character. Therefore I don’t performance concern is hypothetical
for naive handling (without overlay merging). This can easily result in
> 10k overlays in the worst case for a medium sized buffer.

> The performance concern is largely hypothetical, and if it ever proves
> real, we have a branch waiting to be merged that reimplement overlays
> in a more efficient (algorithmically) way.
Thanks for the information. I’ll implement using overlay+merging then.
It will probably work for most cases for now, and let that branch fix
the pathological case where user inputs largely interleaves in the future.
(The case sounds implausible, but it could happen, e.g. when
using crdt.el to share an artist-mode buffer)

  reply	other threads:[~2021-08-30  0:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-29  4:13 Question: add-face-text-property for 'font-lock-face? Qiantan Hong
2021-08-29  4:24 ` Yuan Fu
     [not found]   ` <B73E855F-7E55-4217-BD43-E1272939E491@mit.edu>
2021-08-29  4:36     ` Qiantan Hong
2021-08-30  8:22       ` Ihor Radchenko
     [not found]     ` <945E4D23-3D8C-45AB-9C10-992638A30607@gmail.com>
2021-08-29  4:47       ` Qiantan Hong
2021-08-29 23:50         ` Stefan Monnier
2021-08-29  7:05 ` Eli Zaretskii
2021-08-29  7:19   ` Qiantan Hong
2021-08-29  7:49     ` Eli Zaretskii
2021-08-29 16:15       ` Clément Pit-Claudel
2021-08-29 21:13         ` Qiantan Hong
2021-08-29 23:47           ` Stefan Monnier
2021-08-30  0:41             ` Qiantan Hong [this message]
2021-08-30  8:18             ` Ihor Radchenko
2021-08-29 16:13 ` Clément Pit-Claudel

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=BF152765-F534-4AF8-B8BA-EBC9413E8AA6@mit.edu \
    --to=qhong@mit.edu \
    --cc=cpitclaudel@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

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