From 6628be853e521167ca1dddbfc687cf27c486dad2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabi=C3=A1n=20Ezequiel=20Gallina?= Date: Mon, 28 Jul 2014 18:07:10 -0300 Subject: [PATCH] * lisp/progmodes/python.el (inferior-python-mode): Make input prompts read-only. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/python.el | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fbbce6e4db7..4a54d4e2df6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-07-28 Fabián Ezequiel Gallina + + * progmodes/python.el (inferior-python-mode): Make input prompts + read-only. + 2014-07-28 Emilio C. Lopes * net/tramp-sh.el (tramp-get-remote-python): Also search for diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b08da8da029..d1dd9bef4bc 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2357,7 +2357,8 @@ variable. (set (make-local-variable 'python-shell--prompt-calculated-input-regexp) nil) (set (make-local-variable 'python-shell--prompt-calculated-output-regexp) nil) (python-shell-prompt-set-calculated-regexps) - (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp) + (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp + comint-prompt-read-only t) (setq mode-line-process '(":%s")) (set (make-local-variable 'comint-output-filter-functions) '(ansi-color-process-output @@ -2381,6 +2382,10 @@ variable. (compilation-shell-minor-mode 1) ;; Ensure all the output is accepted before running any hooks. (accept-process-output (get-buffer-process (current-buffer))) + ;; At this point, all process output should have been received, but + ;; on GNU/Linux, calling `python-shell-internal-send-string' without + ;; a running internal shell fails to grab output properly unless + ;; this `sit-for' is in place. (sit-for 0.1 t)) (defun python-shell-make-comint (cmd proc-name &optional pop internal) -- 2.11.4.GIT