Su 'python-shell-interpreter' no parece ser compatible con readline

Pregunta:

Tengo este problema con mi 25.1 y Python 3.5 en Ubuntu 16.10, pero no veo que se resuelva en ninguna parte. Preguntándose cuál era el estado más reciente. Reproducir:

> emacs -Q --eval '(setq python-shell-interpreter "python3")'

entonces

Mx run-python da

Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native’ was t and "python3" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list.  Native completions have been disabled locally.

Vi una idea en la que una Mx find-function python-shell-completion-native-try sacaría la función desde lo profundo (/usr/local/share/emacs/25.1/lisp/progmodes/python.el.gz y el muy se suponía que la última línea era nil "_"))) y no nil ""))) . Otra conversación aquí habla sobre cambiar inputrc

Cambié a otro usuario y pude usar 'run-python' sin ninguna advertencia. Resulta que era mi configuración de readline. Bash 4.3 agregó una nueva función de readline: "establecer estadísticas de colores en" que tenía en .inputrc. Eliminar esa línea solucionó mi problema, creo que esto debería ser reproducible para todos.

¿Alguien sabe qué es lo último en esto? Por cierto, ejecutar Python2 ( (setq org-babel-python-command "python2") ) no tiene este problema.

Respuesta:

Si no desea obtener un rc 25.2, puede aplicar la corrección de errores agregando esto a su archivo init.el:

(with-eval-after-load 'python
  (defun python-shell-completion-native-try ()
    "Return non-nil if can trigger native completion."
    (let ((python-shell-completion-native-enable t)
          (python-shell-completion-native-output-timeout
           python-shell-completion-native-try-output-timeout))
      (python-shell-completion-native-get-completions
       (get-buffer-process (current-buffer))
       nil "_"))))

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25753#44

Leave a Comment

Your email address will not be published. Required fields are marked *

web tasarım