Martin Vermeer wrote:
Secondly (and much more importantly), because CT itself is *very* complicated any way you look at it, regardless of the implementation details. I don't believe it would have been easier if you had used insets.

After I wrote my answer to John (I used to believe this too)
I have changed my opinion on this: I now think an inset based
solution would have been actually simpler.

You would have two inset types: "red" (deleted stuff) and "blue"
(inserted stuff) insets. When switching CT on, typing into the
main text would be blocked (but see below). The only LFUNs working there would be selection, and the only thing you could do with a selection, enclosing it in a red inset.

Inside a red inset, no LFUN would work. Inside a blue inset,
you could type normally and also use delete and backspace.

Next, we extend this by allowing typing in the main text. The
first char typed should create a blue inset and place the
cursor inside. Using delete/backspace in the main text creates
a red inset containing the deleted character / selected interval
(e.g., one containing only a par break). You would need
a background clean-up routine to merge all these single-position
red insets.

The only "spaghetti" I see in this approach is in modifying the
main-text dispatch routine for CT. All of the detailed paragraph and par break handling would be encapsulated in the insets. Also the existing, complex bookkeeping system
for CT ranges would be replaced by re-using the existing
one for insets. (One thing to look at when generalizing the
range code.)

Output is simple too: acceptance means dissolving blue and
deleting red insets, rejection the reverse. Previewing this
is easy using close/open all insets (of a type, not yet impl.)

A bit late in the game to go for this now, but something to keep in mind.


Hmmm... I admit this sounds very interesting. It is certainly out-of-the-box (or rather, in-the-box (inset) ?!) thinking, and perhaps it could work... :)

And also the advantage that Abdel pointed out --- "accept = dissolve, refuse = delete" is nice...

Reply via email to