--- i/lisp/progmodes/python.el +++ w/lisp/progmodes/python.el @@ -3399,24 +3399,30 @@ python-shell-completion-native-setup instance.rlcomplete = new_completer if readline.__doc__ and 'libedit' in readline.__doc__: - readline.parse_and_bind('bind ^I rl_complete') + # readline.parse_and_bind('bind ^I rl_complete') + print ('libedit not supported') else: readline.parse_and_bind('tab: complete') # Require just one tab to send output. readline.parse_and_bind('set show-all-if-ambiguous on') + print ('python.el: native completion setup loaded') - print ('python.el: native completion setup loaded') except: print ('python.el: native completion setup failed') __PYTHON_EL_native_completion_setup()" process) - (when (and - (python-shell-accept-process-output - process python-shell-completion-native-try-output-timeout) - (save-excursion - (re-search-backward - (regexp-quote "python.el: native completion setup loaded") nil t 1))) - (python-shell-completion-native-try))))) + (when (python-shell-accept-process-output + process python-shell-completion-native-try-output-timeout) + (cond ((save-excursion + (re-search-backward + (regexp-quote "python.el: native completion setup loaded") nil t 1)) + (python-shell-completion-native-try)) + ((save-excursion (search-backward "libedit" nil t 1)) + (lwarn '(python libedit) + :error "\ +Your `python-shell-interpreter' uses a libedit based readline +module which is currently not supported.") + nil)))))) (defun python-shell-completion-native-turn-off (&optional msg) "Turn off shell native completions.