[Pythonmac-SIG] CommandHistoryPatch update

Oliver Steele steele@cs.brandeis.edu
Sat, 23 Oct 1999 07:58:37 -0400


Thanks for your suggestions, everyone!  I've changed the previous history
key to ctl-uparrow (option-p was indeed a holdover from my MCL days); added
ctl-downarrow for next history; and added the feature where typing on a
previous line appends that line to the current input.

Enter/Return just appends the text of the line the selection is on (so press
Return twice to execute it).  Any other non-navigation key appends the text,
repositions the selection, and then types the key.  This sounds complicated,
but I think it works well; try it, and tell me what you think.

The new patch is available from
<http://www.cs.brandeis.edu/~steele/sources/python.html>, as
<http://www.cs.brandeis.edu/~steele/sources/CommandHistoryPatch.py>.
PatchUtils.py does the right thing, so you can just drop
CommandHistoryPatch.py on the interpreter, and it will ask you if you want
to update the old one.

By the way, I extended (by subclassing) PatchUtils.Patch with a ReplaceLines
command, since I needed to replace multiple lines.  I wouldn't mind if this
code were moved into PatchUtils.py.