GNU bug report logs - #52380
28.0.50; [PATCH] run-python no longer focuses interpreter

Previous Next

Package: emacs;

Reported by: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>

Date: Wed, 8 Dec 2021 23:11:02 UTC

Severity: normal

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 52380 <at> debbugs.gnu.org (full text, mbox):

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 52380 <at> debbugs.gnu.org
Subject: ERT, buffers and windows (was: bug#52380: 28.0.50; [PATCH]
 run-python no longer focuses interpreter)
Date: Fri, 10 Dec 2021 21:09:30 +0100
Kévin Le Gouguec <kevin.legouguec <at> gmail.com> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>>
>>> Makes sense to me; pushed to emacs-28.
>>
>> But then I reverted it, because it led to a test failure, so could you
>> have a look at that?
>
> Well great; I meant to write a test case for that eventually.
>
> Assuming you mean python-tests--bug31398?  That's the one I'm seeing
> failing with my patch.
>
> I've banged my head on it for an hour now; I don't understand what's
> going on.  The test case is checking precisely what I was trying to fix,
> and for some reason the set-buffer I removed does something that the
> pop-to-buffer I replaced it with doesn't.
>
> What set-buffer does not, of course, is actually work in interactive
> usage 😒

If I amend the test as follows:

diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 15bda5c197..783f115fc7 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -5454,6 +5454,7 @@ python-tests--bug31398
   "Test for https://debbugs.gnu.org/31398 ."
   (skip-unless (executable-find python-tests-shell-interpreter))
   (let ((buffer (process-buffer (run-python nil nil 'show))))
+    (should (eq (get-buffer-window buffer) (selected-window)))
     (should (eq buffer (current-buffer)))
     (pop-to-buffer (other-buffer))
     (run-python nil nil 'show)

… then (should (eq (get-buffer-window buffer) (selected-window)))
passes, but (should (eq buffer (current-buffer))) does not.  Does that
make sense to anyone?




This bug report was last modified 3 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.