blefloch / latex-unravel

Watching TeX digest tokens
24 stars 1 forks source link

Rewind steps #9

Open blefloch opened 8 years ago

blefloch commented 8 years ago

There are many situations where it would be a life saver to rewind steps. Typically, I use \unravel to find what caused a TeX error. It would be nice to let unravel run a few steps at a time, then to stop once I see the error, and rewind a couple of steps to determine what when wrong.

It seems impossible to undo global assignments. But this is not needed! Assignments do not really have to be performed. The values of macros and other parameters, must be saved, but they are only ever used by unravel, which could be built to look for saved values rather than current values.

The following must be saved. Save input/prev/output stacks every few steps (repeatedly discard every other one once old, like one would do for backups). Save previous values for all assignments. Save the "outcome" of every step.

Some structural changes are needed, so don't expect this issue to be closed any time soon.