Krystian RosiĆski notified me about an error with Tabify/Untabify. Clicking cancel still performs the operation because the _asktabwidth function in Lib/idlelib/EditorWindow.py always returns a number, regardless of cancel being clicked. This bug is visibly noticeable with IdleX since it highlights all \t Tabs, but not with the original IDLE. The attached patch solves the problem.
Roger, I tested the patch and it does seem to function as you describe so feel free to apply the patch. The tabify function makes me scratch my head a little, according to help.txt: "Tabify Region -- Turns *leading* stretches of spaces into tabs (Note: We recommend using 4 space blocks to indent Python code.)" Yet this code doesn't seem to get tabifyed. a=[1,2,3,4,5] for i in range(0, len(a)): print("%d" % a[i]) I would expect that the print statement be tabbed in but on my Mac it does not seem to do that it just puts back in the single space in front of the print. This might be a separate issue but I was wondering if perhaps I misunderstand the purpose of this function?
Todd, Tabify/Untabify are functions to deal with the great tabs vs. spaces debate (though PEP8 says that spaces are the way to go). The tabify function needs a minimum of 2 spaces before it replaces it with a tab. Its implementation in Lib/idlelib/EditorWindow.py under the tabify_region_event and untabify_region_event reveals a curiousity in its implementation. Tabify will replace spans of space characters with tabs, but still leave in extra space characters if needed. Untabify simply expands all tabs to a fixed number of spaces.