From c7815c384be68b5ec6fbf3207ec59eb45cb21896 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabi=C3=A1n=20Ezequiel=20Gallina?= Date: Thu, 17 May 2012 00:03:30 -0300 Subject: [PATCH] Make `python-shell-send-string-no-output' delete trailing newlines from output. --- lisp/progmodes/python.el | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index a2f1ed4e809..f75b5cb51ae 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1467,16 +1467,14 @@ the output." ""))))) (python-shell-send-string string process msg) (accept-process-output process) - (mapconcat - (lambda (string) string) - (split-string - output-buffer - (if (> (length python-shell-prompt-output-regexp) 0) - (format "\n*%s$\\|^%s" - python-shell-prompt-regexp - (or python-shell-prompt-output-regexp "")) - (format "\n$\\|^%s" - python-shell-prompt-regexp)) t) "\n"))) + (replace-regexp-in-string + (if (> (length python-shell-prompt-output-regexp) 0) + (format "\n*%s$\\|^%s\\|\n$" + python-shell-prompt-regexp + (or python-shell-prompt-output-regexp "")) + (format "\n*$\\|^%s\\|\n$" + python-shell-prompt-regexp)) + "" output-buffer))) (defun python-shell-internal-send-string (string) "Send STRING to the Internal Python interpreter. -- 2.39.5