Oct 18, 2024
I've been thinking about Potluck and the Emacs model of text augmented with attributes for ranges. Potluck describes 3 mechanisms:
- extracting data using (regex) patterns
- performing computations on that data
- showing results of computation as annotations
My notebook app does simple variants of 2 and 3, and replaces 1 with explicit in-document markup.
Now I'm playing with another approach to 1. I already have the idea of pivots from my doodle app. Putting two of those pivots together should yield a range that adjusts in intuitive ways in the presence of edits. An example may be a WYSIWYG UI for adding a hyperlink to some text:
- Inserting/deleting text before a range moves it.
- Inserting/deleting text after a range leaves it unchanged.
- Inserting/deleting text within a range grows/shrinks it.
- Deleting text at a boundary shrinks the range, and only deletes the attached attributes if the range becomes empty. This makes ranges more robust to deletion than my doodles which attached to a single pivot.
- Inserting text at boundaries can't always do what you want. I imagine it'd be nice to have handles that you can drag to adjust a range.
This post is part of my Freewheeling Apps Devlog.
Comments gratefully appreciated. Please send them to me by any method of your choice and I'll include them here.