From 6628be853e521167ca1dddbfc687cf27c486dad2 Mon Sep 17 00:00:00 2001 From: Fabián Ezequiel Gallina Date: Mon, 28 Jul 2014 18:07:10 -0300 Subject: * lisp/progmodes/python.el (inferior-python-mode): Make input prompts read-only. --- lisp/progmodes/python.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp/progmodes/python.el') 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) -- cgit v1.2.1