]> git.eshelyaron.com Git - emacs.git/commitdiff
Give more helpful messages for python completion setup failures
authorNoam Postavsky <npostavs@gmail.com>
Tue, 3 Oct 2017 02:54:36 +0000 (22:54 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Tue, 3 Oct 2017 03:15:43 +0000 (23:15 -0400)
* lisp/progmodes/python.el (python-shell-completion-native-setup): In
case the completion setup failed with some exception, print out the
exception type and message.  If libedit is detected, raise an
exception, since this is known to fail.

lisp/progmodes/python.el

index 365191c56b02a42f2899ae9c83a40cc33b9dc6fe..9aa5134ca0de63252286c409265e366f7868d4b2 100644 (file)
@@ -3442,6 +3442,8 @@ def __PYTHON_EL_native_completion_setup():
                 instance.rlcomplete = new_completer
 
         if readline.__doc__ and 'libedit' in readline.__doc__:
+            raise Exception('''libedit based readline is known not to work,
+      see etc/PROBLEMS under \"In Inferior Python mode, input is echoed\".''')
             readline.parse_and_bind('bind ^I rl_complete')
         else:
             readline.parse_and_bind('tab: complete')
@@ -3450,7 +3452,9 @@ def __PYTHON_EL_native_completion_setup():
 
         print ('python.el: native completion setup loaded')
     except:
-        print ('python.el: native completion setup failed')
+        import sys
+        print ('python.el: native completion setup failed, %s: %s'
+               % sys.exc_info()[:2])
 
 __PYTHON_EL_native_completion_setup()" process)
       (when (and