Tkinter: text widget predefined key bindings

Edward K. Ream edream at
Wed Aug 28 15:28:01 CEST 2002

Leo supports unlimited undo/redo, not only for "typing" cases but for all
outline operations as well.  It's not trivial, and I find it relatively easy
to extend.

The code, in a Leo outline, of course, is in  You can look at
the code by downloading version 3.5 of from

You can also look at just on the CVS tree at
but this will be much less clear than looking at the Leo outline.

As has been stated, one must handle cut/paste and any other operation that
affects text.

The theory of operation is in the section of called
<< How Leo implements unlimited undo >>
The heavy lifting is handled by the undo() and redo() routines.  External
code calls the "state routines", particularly setUndoParams().

Hope this helps.

Edward K. Ream   email:  edream at
Leo: Literate Editor with Outlines

More information about the Python-list mailing list