[python mode] Adjust coding style, add hintWords helper
[emacs mode] Fix test, and issue caused by test

For tranposeChars

Issue #2507
[python mode] Clean up indentation and scope tracking

Issue #2503