From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter Date: Sat, 11 Dec 2021 23:23:15 +0100 Message-ID: <87pmq2233g.fsf@gmail.com> References: <87pmq666cb.fsf@gmail.com> <874k7gzmto.fsf@gnus.org> <87y24sy863.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35829"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 52380@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 11 23:24:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mwAmp-00095K-QU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Dec 2021 23:24:11 +0100 Original-Received: from localhost ([::1]:56202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwAmn-0000DQ-MJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Dec 2021 17:24:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwAmh-0000DG-JV for bug-gnu-emacs@gnu.org; Sat, 11 Dec 2021 17:24:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwAmg-0007BU-0I for bug-gnu-emacs@gnu.org; Sat, 11 Dec 2021 17:24:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mwAmf-0003mm-PR for bug-gnu-emacs@gnu.org; Sat, 11 Dec 2021 17:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Dec 2021 22:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52380 X-GNU-PR-Package: emacs Original-Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.163926140614507 (code B ref 52380); Sat, 11 Dec 2021 22:24:01 +0000 Original-Received: (at 52380) by debbugs.gnu.org; 11 Dec 2021 22:23:26 +0000 Original-Received: from localhost ([127.0.0.1]:50218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwAm6-0003lv-K4 for submit@debbugs.gnu.org; Sat, 11 Dec 2021 17:23:26 -0500 Original-Received: from mail-wm1-f48.google.com ([209.85.128.48]:43575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwAm2-0003lh-LW for 52380@debbugs.gnu.org; Sat, 11 Dec 2021 17:23:25 -0500 Original-Received: by mail-wm1-f48.google.com with SMTP id o19-20020a1c7513000000b0033a93202467so9183646wmc.2 for <52380@debbugs.gnu.org>; Sat, 11 Dec 2021 14:23:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=K7tsdbufzOTXNZTxNPtUfxUj31Llw5/CvqarecbU0bY=; b=QUCY/CKiA2XeQYLkbnjZQS3ckwQ0vnDDNyK1phdqAmKYN4h4GbBZS77H2YEaMe/lID I+6rF/5RkjspFnyus50qHW37PJvyPh7xGMcCZEGhztVEmJFCwhV3ozLUncoGoDDfR3Ce uzMM5oh/gkkCH8zYY2GoraQSIyw/opElLwwedClykM5EodxMtBXN2H5qKqKLUbfc/7Ni Qhnd6ocUnJviSz28suO3eE0EqDic3feKw7XuqEE9OSJT+akNWcdETpCL9R4MjkXv2Dfl 7/h/3EdwoOynXF3Y1430Oi0cI+Q8Yi5y92Il8gaHPGPQr+cb+ZcIIGSyPlXns5wnZmqG LeTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=K7tsdbufzOTXNZTxNPtUfxUj31Llw5/CvqarecbU0bY=; b=jKoJ7UQUJi7vRmkMramTRTzkLFBBRXOANzrc1pDA+6jtWythRIKYZAq+MqMpU1G+Rm PP2JnS0AQoBCCAjmn5TdAju1UuFJJT0+R+yJ2gwXkT8PBjVSx8tjrCfz/LI7RmpJsP/s DNfMo74OY/gKOK2dAWIxIueYBPdmhsFcEnyd1Gjl1x1qC243AYfR82dad8153Om/0zkO 0ZOKiwLWpvnVOt8S65re39jJCsYPOuaixu4cdF3JwTfix7LathrFJDTF70z1I9pmIEHv osakU4MOnNdjlO94USP83e4vTRsO+WxtWZ7UUBsLSLuG+iFkjNcGw6bV7fdcBwGftQb3 aAKg== X-Gm-Message-State: AOAM531TDNm9DtxRAfIEHr2omWKf/lAOQFX76KG1E/kpim7dUcNoNX3m pbcsxhKgegv7tnZoyqYYPzIUGpijGGc= X-Google-Smtp-Source: ABdhPJwPcBX8C4JPw0LoUBucPztLz4UAPHBy8lzoGmfyWjsvs4JUErxjiZozYTgwaOGQB1EU0YBgWQ== X-Received: by 2002:a7b:cf02:: with SMTP id l2mr27092170wmg.78.1639261396363; Sat, 11 Dec 2021 14:23:16 -0800 (PST) Original-Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id t4sm2415187wmi.48.2021.12.11.14.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Dec 2021 14:23:15 -0800 (PST) In-Reply-To: <87y24sy863.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 10 Dec 2021 13:08:04 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:222153 Archived-At: Lars Ingebrigtsen writes: > Lars Ingebrigtsen 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, =E2=80=A6 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=E2=80=A6 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".