emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 07335abeb4: Fix python-eldoc affecting unrelated comint processes


From: Lars Ingebrigtsen
Subject: master 07335abeb4: Fix python-eldoc affecting unrelated comint processes
Date: Fri, 14 Jan 2022 02:34:34 -0500 (EST)

branch: master
commit 07335abeb41654ad6555284e3d0c1ae21e77469b
Author: Miha Rihtaršič <miha@kamnitnik.top>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix python-eldoc affecting unrelated comint processes
    
    * lisp/progmodes/python.el (python-shell-send-string-no-output): Don't
    let-bind comint-preoutput-filter-functions globally for all comint
    processes.  Modify the behaviour of only the current python
    process (bug#53219).
---
 lisp/progmodes/python.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index edd3139a7a..5889f2ab67 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3216,11 +3216,13 @@ detecting a prompt at the end of the buffer."
 (defun python-shell-send-string-no-output (string &optional process)
   "Send STRING to PROCESS and inhibit output.
 Return the output."
-  (let ((process (or process (python-shell-get-process-or-error)))
-        (comint-preoutput-filter-functions
-         '(python-shell-output-filter))
-        (python-shell-output-filter-in-progress t)
-        (inhibit-quit t))
+  (or process (setq process (python-shell-get-process-or-error)))
+  (cl-letf (((process-filter process)
+             (lambda (_proc str)
+               (with-current-buffer (process-buffer process)
+                 (python-shell-output-filter str))))
+            (python-shell-output-filter-in-progress t)
+            (inhibit-quit t))
     (or
      (with-local-quit
        (python-shell-send-string string process)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]