mode improvements both in python and lisp