GNU bug report logs -
#53219
27.2; shell-mode output is stolen by python-eldoc
Previous Next
Reported by: awrhygty <at> outlook.com
Date: Wed, 12 Jan 2022 18:03:04 UTC
Severity: normal
Found in version 27.2
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #13 received at 53219 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> awrhygty <at> outlook.com writes:
>
>> Evaluate the form below and type 'C-p' or 'C-n' repeatedly to display
>> python eldoc messages.
>> After 20-30 key input, an error occurs.
>> Then look at the *shell* buffer, some numbers in output lines are
>> absent.
>> If setting debug-on-error to 't, *Backtrace* buffer popups,
>
> That sounds familiar -- I think I recall something like this being fixed
> in eldoc...
>
> Yes, I can reproduce this problem in Emacs 27.2, but not in Emacs 29.
> So I guess this has been fixed by now, and I'm closing this bug report.
Not quite yet. I found a more reliable reproducer for Emacs 29, which
could reproduce the bug on my machine with emacs -q.
(progn
(setq debug-on-error t)
(shell)
(insert " i=0; while sleep 0.05; do i=$((i + 1)); echo $i; done")
(comint-send-input)
(run-python)
(switch-to-buffer (generate-new-buffer "tmp"))
(insert "len\nstr")
(python-mode))
If it doesn't work bug immediately, try lowering the "0.05" number.
Please consider applying the following patch to fix this.
[0001-Fix-python-eldoc-affecting-unrelated-comint-processe.patch (text/x-patch, inline)]
From 45c345f0b170c3ffc41f186b3c2b70dbccaa23fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miha=20Rihtar=C5=A1i=C4=8D?= <miha <at> kamnitnik.top>
Date: Thu, 13 Jan 2022 18:20:13 +0100
Subject: [PATCH] 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 @@ python-shell-output-filter
(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)
--
2.34.1
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 128 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.