aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2021-09-09 20:08:56 +0300
committerEli Zaretskii2021-09-09 20:08:56 +0300
commitbac632aaec3add5c8ecaf75ea481b93ac8c1a2cb (patch)
tree8e85a6037f94b7fae111924ef8a59e2fa3658177
parent8c023e5ea159c6756c92fd02643983aa449e0da9 (diff)
downloademacs-bac632aaec3add5c8ecaf75ea481b93ac8c1a2cb.tar.gz
emacs-bac632aaec3add5c8ecaf75ea481b93ac8c1a2cb.zip
Fix a recent change wrt 'comint-max-line-length'
* lisp/progmodes/python.el (python-shell-send-string): Only heed 'comint-max-line-length' for subprocesses with which we communicate via PTYs. (Bug#49822) * lisp/comint.el (comint-max-line-length): Doc fix. Add a value for MS-Windows.
-rw-r--r--lisp/comint.el5
-rw-r--r--lisp/progmodes/python.el3
2 files changed, 6 insertions, 2 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index c2e528a5d53..02878cc6419 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -482,8 +482,11 @@ executed once, when the buffer is created."
482(defconst comint-max-line-length 482(defconst comint-max-line-length
483 (pcase system-type 483 (pcase system-type
484 ('gnu/linux 4096) 484 ('gnu/linux 4096)
485 ('windows-nt 8196)
485 (_ 1024)) 486 (_ 1024))
486 "Maximum line length, in bytes, accepted by the inferior process.") 487 "Maximum line length, in bytes, accepted by the inferior process.
488This setting is only meaningful when communicating with subprocesses
489via PTYs.")
487 490
488(defvar comint-mode-map 491(defvar comint-mode-map
489 (let ((map (make-sparse-keymap))) 492 (let ((map (make-sparse-keymap)))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 8f7bb7a8b60..3fc2700663f 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3152,7 +3152,8 @@ t when called interactively."
3152 (python-shell--encode-string string) 3152 (python-shell--encode-string string)
3153 (python-shell--encode-string (or (buffer-file-name) 3153 (python-shell--encode-string (or (buffer-file-name)
3154 "<string>"))))) 3154 "<string>")))))
3155 (if (<= (string-bytes code) comint-max-line-length) 3155 (if (or (null (process-connection-type process))
3156 (<= (string-bytes code) comint-max-line-length))
3156 (comint-send-string process code) 3157 (comint-send-string process code)
3157 (let* ((temp-file-name (with-current-buffer (process-buffer process) 3158 (let* ((temp-file-name (with-current-buffer (process-buffer process)
3158 (python-shell--save-temp-file string))) 3159 (python-shell--save-temp-file string)))