undo (was Re: Why does Dynamic Typing really matter?!?)

Andrew Dalke adalke at mindspring.com
Sat Feb 8 18:52:54 CET 2003

Edward K. Ream:
> BTW, Python makes implementing this relatively easy.  Each "bead" is
> a dictionary containing whatever is needed to undo _and_ redo the
> setUndoParams has a **keywords parameter.  The caller specifies whatever
> needed as keyword arguments; setUndoParams puts the items of the keywords
> dict into the bead's dict.

One of the papers I read used

class BaseCommand:
  def Do(self):
  def Undo(self):
  def ReDo(self):

I bring this up because it said in a few cases, redoing needed different
than doing.  For example, the original Do may do a pop-up to get more
from the user, or verify a change, or give a "tip of the day" while the redo
do the same thing again.

> You will need to download and install leo2.py 3.10 to read LeoPy.leo,
> although you could read the "raw" code of leoUndo.py at Leo's CVS site:

I did try to install Leo a few weeks ago but ran into some problems.
I posted them in the thread "Hacking Heaven - Leo+XEmacs Integrated"

Doesn't mean I can't take a look at the source code though :)

                    dalke at dalkescientific.com

More information about the Python-list mailing list