← Back to context

Comment by neilv

3 days ago

How would you associate non-character data with ranges of characters, such as for syntax coloring, semantic links, and references to points in the text?

(I couldn't find a mention of this in the README, design.md, or examples.)

In Emacs buffers, the concepts include text properties, overlays, and markers.

That would depend on your editor's implementation.

  • But, within this API, is there any support for the associations with non-character data?

    For example, if you delete some text these Ropey data structure, does Ropey have facilities to update the associated non-character data (such as deleting all or part of one or more chunks of the non-character data, and/or updating positional information)? Or do you have to do that separately outside of Ropey?

    • A rope is only concerned with manipulating a string with very low cpu overhead while maintaining the illusion of a sequence of characters or bytes. It doesn't really care or maintain any other text decoration you might be maintaining. That is the concern of the consumer of the rope and I'm not sure there is a good common interface for that.

      6 replies →

I'm sorry, it's only vaguely related, but maybe someone can share some ideas.

What would be some good use-cases for using Ropey with Emacs? Maybe re-formatting/beautifying huge json files or something like that?

I didn't have time yet to explore the project more closely, but it looks very interesting.