I've been thinking about <Potluck> and <the Emacs ...
# devlog-together
k
I've been thinking about Potluck and the Emacs model of text augmented with attributes for ranges. Potluck describes 3 mechanisms: 1. extracting data using (regex) patterns 2. performing computations on that data 3. 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. Think of a range as something like a hyperlink you add to a comment in a UI like this Slack app we're in right now: • 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 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.
j
I think I’ll need to feel this to know what I think about it
k
Try it out, you mean? I'll send you something. Would you also like to try out the doodle app or notebook app I alluded to?
Here are a few apps to try out. 1. Download LÖVE for your OS from https://love2d.org 2. Run the apps:
love doodle2.love
, etc. Run notebook.love with the attached example file:
love notebook.love freezer
. In doodle2, press
F1
to toggle between text mode and doodle mode. In text2-with-attributes.love, select some text and then press
F1
to turn it into a persistent range. This video may help; certainly ask me questions if anything is unclear.