> However, when I try this in an ipython session inside emacs, I have to > hit TAB followed by a carriage return. The TAB actually prints to the > screen. > > Does anyone know how to prevent the tab from printing, and, how to not > require hitting enter?
A quick and dirty way might be to define something like: (defun py-electric-tab () (interactive) (comint-send-string "*Python*" "\t")) And then bind that to some key (e.g., alt-tab). If you wanted to bind it to tab itself (i.e., without a modifier like alt), then you'd need some magic to distinguish the use of tab to do indentation (in which case it should insert a tab in the buffer) from tab to do autocompletion. For a more principled way, perhaps look at the comint-dynamic-complete function, defined in comint.el [1]? -Edward [1] http://www.cs.indiana.edu/pub/scheme-repository/utl/comint.el _______________________________________________ Python-mode mailing list [email protected] http://mail.python.org/mailman/listinfo/python-mode
