all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 52380@debbugs.gnu.org
Subject: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter
Date: Sat, 11 Dec 2021 23:23:15 +0100	[thread overview]
Message-ID: <87pmq2233g.fsf@gmail.com> (raw)
In-Reply-To: <87y24sy863.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 10 Dec 2021 13:08:04 +0100")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Lars Ingebrigtsen <larsi@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?

Based on my understanding of

- my digression on buffers and windows in my subthread on ERT,

- how buffer "currentness" relates to window "selectedness" in the
  context of a regular command loop vs during a test execution,

- what Tino attempted to fix with bug#31398,

… my inclination would be to (1) keep my patch as-is, (2) amend the test
to check (selected-window) rather than (current-buffer), and (3) add a
comment to explain what we want to test and why we do it that way[1].

We could keep the call to (set-buffer) in run-python, but AFAICT it's
redundant for user interaction: pop-to-buffer selects the window, so
when the command loop returns to the user the *Python* buffer will be
made current anyway.

Does this sound… sound?  If so, I'll submit a v2 amending
python-tests--bug31398.


[1] And optionally (4) start a thread on emacs-devel to better
    understand ERT pitfalls.  I seem to keep stumbling on them; I dimly
    remember struggling to write Elisp code that would reproduce a
    tricky issue with undo and electric-pair-mode (that was 100%
    reproducible interactively), and struggling to write font-lock tests
    because some fontification passes are not triggered unless something
    happens interactively.

    (Or something.  I'll do my research before starting this thread,
    obviously)

    I think at the very least, some documentation of these issues in the
    ERT manual would help; ideally ERT could also provide helpers to
    simulate a "regular command loop".





  parent reply	other threads:[~2021-12-11 22:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 23:10 bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter Kévin Le Gouguec
2021-12-10 12:06 ` Lars Ingebrigtsen
2021-12-10 12:08   ` Lars Ingebrigtsen
2021-12-10 19:26     ` Kévin Le Gouguec
2021-12-10 20:09       ` bug#52380: ERT, buffers and windows (was: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter) Kévin Le Gouguec
2021-12-10 20:30         ` Eli Zaretskii
2021-12-10 20:58           ` bug#52380: ERT, buffers and windows Kévin Le Gouguec
2021-12-11 22:23     ` Kévin Le Gouguec [this message]
2021-12-12  6:40       ` bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter Lars Ingebrigtsen
2021-12-12 14:03         ` bug#52380: 28.0.50; [PATCH v2] " Kévin Le Gouguec
2021-12-13  4:17           ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmq2233g.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=52380@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.