From 4a983cae2f36d96ae60eb0f0413912d524ad65d7 2011-11-19 19:21:40 From: Pete Aykroyd Date: 2011-11-19 19:21:40 Subject: [PATCH] Ensures that ipython-complete is called. python-mode defines a key-binding for the tab key for its own completion function (py-shell-complete) if that one wins, then py-shell-complete will hang emacs as it tries to communicate with the python shell process which does not exist. This uses def-advice to instead call ipython-complete when py-shell-complete is called. --- diff --git a/docs/emacs/ipython.el b/docs/emacs/ipython.el index ccdb54f..1b11e5f 100644 --- a/docs/emacs/ipython.el +++ b/docs/emacs/ipython.el @@ -423,6 +423,14 @@ in the current *Python* session." (message "Making completion list...%s" "done"))))) ) +;;; if python-mode's keybinding for the tab key wins then py-shell-complete is called +;;; instead of ipython-complete which result in hanging emacs since there is no shell +;;; process for python-mode to communicate with +(defadvice py-shell-complete + (around avoid-py-shell-complete activate) + (ipython-complete)) + + ;;; autoindent support: patch sent in by Jin Liu , ;;; originally written by doxgen@newsmth.net ;;; Minor modifications by fperez for xemacs compatibility.