I'm using Emacs 24.4.1 on OSX (installed with Homebrew), with the built in python.el
, and Python 3 (also installed with Homebrew), along with IPython 2.3.0. I have this in my .emacs
:
(setq
python-shell-interpreter "/usr/local/bin/ipython3"
python-shell-prompt-regexp "In \\[[0-9]+\\]: "
python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: "
python-shell-completion-setup-code
"from IPython.core.completerlib import module_completion"
python-shell-completion-module-string-code
"';'.join(module_completion('''%s'''))\n"
python-shell-completion-string-code
"';'.join(get_ipython().Completer.all_completions('''%s'''))\n")
Everything works correctly when I invoke M-x run-python
, except one thing: the <tab>
-completion of module names doesn't work in the REPL (it says "No match" in the *Messages*
buffer). I'm pretty sure it was working with Emacs 24.3, which I upgraded very recently, but I'm not 100% sure. Anyone has an idea what might cause this, or how I could try to debug it?
Update:
After having set debug-on-message
to "No match"
as suggested by @Constantine below, trying to do:
In [4]: import nump<tab>
yields:
Debugger entered--Lisp error: "No match"
message("%s" "No match")
minibuffer-message("No match")
completion--message("No match")
completion--do-completion(#<marker at 406 in *Python*> 410)
completion--in-region-1(#<marker at 406 in *Python*> 410)
#[1028 "\n\203!\304!\203\202\305!\305\306\"F\307\310!\210\311\"*\207" [minibuffer-completion-predicate minibuffer-completion-table completion-in-region-mode-predicate completion-in-region--data markerp copy-marker t completion-in-region-mode 1 completion--in-region-1] 8 "\n\n(fn START END COLLECTION PREDICATE)"](#<marker at 406 in *Python*> 410 #[771 "\211\242\301=\206\n\211\302=?\205+r\303 \304!\203\305!\202p\262q\210\306\300!$)\207" [(closure (t) (&rest args) (apply (quote python-shell-completion-get-completions) (quote #<process Python>) (quote "import nump") args)) boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil)
apply(#[1028 "\n\203!\304!\203\202\305!\305\306\"F\307\310!\210\311\"*\207" [minibuffer-completion-predicate minibuffer-completion-table completion-in-region-mode-predicate completion-in-region--data markerp copy-marker t completion-in-region-mode 1 completion--in-region-1] 8 "\n\n(fn START END COLLECTION PREDICATE)"] (#<marker at 406 in *Python*> 410 #[771 "\211\242\301=\206\n\211\302=?\205+r\303 \304!\203\305!\202p\262q\210\306\300!$)\207" [(closure (t) (&rest args) (apply (quote python-shell-completion-get-completions) (quote #<process Python>) (quote "import nump") args)) boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil))
#[771 ":\2030@\301=\203\300\242\302A\"\303#\207\304@\305\306\307\310\311\312\300!\313\"\314\315%A##\207\304\316\"\207" [(#0) t append nil apply apply-partially make-byte-code 642 "\300\242#\207" vconcat vector [] 7 "\n\n(fn FUNS GLOBAL &rest ARGS)" #[1028 "\n\203!\304!\203\202\305!\305\306\"F\307\310!\210\311\"*\207" [minibuffer-completion-predicate minibuffer-completion-table completion-in-region-mode-predicate completion-in-region--data markerp copy-marker t completion-in-region-mode 1 completion--in-region-1] 8 "\n\n(fn START END COLLECTION PREDICATE)"]] 12 "\n\n(fn FUNS GLOBAL ARGS)"](nil nil (#<marker at 406 in *Python*> 410 #[771 "\211\242\301=\206\n\211\302=?\205+r\303 \304!\203\305!\202p\262q\210\306\300!$)\207" [(closure (t) (&rest args) (apply (quote python-shell-completion-get-completions) (quote #<process Python>) (quote "import nump") args)) boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil))
completion--in-region(#<marker at 406 in *Python*> 410 #[771 "\211\242\301=\206\n\211\302=?\205+r\303 \304!\203\305!\202p\262q\210\306\300!$)\207" [(closure (t) (&rest args) (apply (quote python-shell-completion-get-completions) (quote #<process Python>) (quote "import nump") args)) boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil)
completion-in-region(#<marker at 406 in *Python*> 410 #[771 "\211\242\301=\206\n\211\302=?\205+r\303 \304!\203\305!\202p\262q\210\306\300!$)\207" [(closure (t) (&rest args) (apply (quote python-shell-completion-get-completions) (quote #<process Python>) (quote "import nump") args)) boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil)
completion-at-point()
python-shell-completion-complete-or-indent()
call-interactively(python-shell-completion-complete-or-indent nil nil)
command-execute(python-shell-completion-complete-or-indent)
My current Emacs-fu is not enough to allow me to understand the problem from that stacktrace alone, but perhaps someone could?