]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix python-eldoc affecting unrelated comint processes
authorMiha Rihtaršič <miha@kamnitnik.top>
Fri, 14 Jan 2022 07:33:58 +0000 (08:33 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 14 Jan 2022 07:34:27 +0000 (08:34 +0100)
* 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

index edd3139a7aa47bfce5b03ac46d66fd98380fe830..5889f2ab670b293c2045fa8ecf9e0de5fd637ea8 100644 (file)
@@ -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)