Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No tab completion for IPython in Emacs textmode

When I run IPython inside emacs in textmode (i.e. inside a terminal), I don't get any tab completion. Rather than given tab completion it jumps four spaces.

When I run emacs in normal GUI mode there is fine tab completion.

Is there a way to fix that for text mode?

I'm using Linux Mint 15, Emacs 24.3 and IPython 1.1.0

like image 429
Mads Jensen Avatar asked Nov 02 '22 10:11

Mads Jensen


2 Answers

Try this:

(eval-after-load "python"
  '(define-key inferior-python-mode-map "\t" 'python-shell-completion-complete-or-indent)

If this works for you, you may have a misconfiguration problem that is preventing python mode to load correctly in your setup.

like image 54
juanleon Avatar answered Dec 15 '22 01:12

juanleon


I recently encountered the same problem and after some search I found that this problem is caused by the difference between <tab> and TAB. The Emacs wiki has a page describes the difference: http://www.emacswiki.org/emacs/TabKey .

In my python.el, the python-shell-completion-complete-or-indent is bind to <tab> which works fine for GUI but not for CLI. Change the binding to TAB will fix this problem.

like image 24
Haochen Wu Avatar answered Dec 15 '22 01:12

Haochen Wu