python.el: Increase native completion robustness
commit911ed2eba4ad691b35e4b81bcd8b24f58b0375ca
authorFabián Ezequiel Gallina <fgallina@gnu.org>
Thu, 9 Apr 2015 03:53:18 +0000 (9 00:53 -0300)
committerFabián Ezequiel Gallina <fgallina@gnu.org>
Thu, 9 Apr 2015 03:53:18 +0000 (9 00:53 -0300)
tree3aa062e31c3e665f6e65a04c10d25da4c42d124b
parentc44f5b046b3f8e9a742c583880ae3a3f78828944
python.el: Increase native completion robustness

Fixes: debbugs:19755

Thanks to Carlos Pita <carlosjosepita@gmail.com> for reporting
this and providing useful ideas.

* lisp/progmodes/python.el
(python-shell-completion-native-output-timeout): Increase value.
(python-shell-completion-native-try-output-timeout): New var.
(python-shell-completion-native-try): Use it.
(python-shell-completion-native-setup): New readline setup avoids
polluting current context, ensures output when no-completions are
available and includes output end marker.
(python-shell-completion-native-get-completions): Trigger with one
tab only.  Call accept-process-output until output end is found or
python-shell-completion-native-output-timeout is exceeded.
lisp/progmodes/python.el