From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Dec 2021 23:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 52380@debbugs.gnu.org Cc: Lars Ingebrigtsen X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163900503822987 (code B ref -1); Wed, 08 Dec 2021 23:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Dec 2021 23:10:38 +0000 Received: from localhost ([127.0.0.1]:41865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mv657-0005yg-S0 for submit@debbugs.gnu.org; Wed, 08 Dec 2021 18:10:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:33480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mv654-0005yX-K8 for submit@debbugs.gnu.org; Wed, 08 Dec 2021 18:10:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mv654-0004VZ-G3 for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2021 18:10:34 -0500 Received: from [2a00:1450:4864:20::436] (port=38780 helo=mail-wr1-x436.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mv652-0002jl-Ds for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2021 18:10:34 -0500 Received: by mail-wr1-x436.google.com with SMTP id q3so6744366wru.5 for ; Wed, 08 Dec 2021 15:10:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version; bh=hXRqEYfc4fYUePT5VGlWMSsNoUZahZ3UX7VY12xoF44=; b=du468JwsXdtZycfjd+oPkWEK1MDKwo7f7TUziBJoHvR3rZLl4+u0u1Ic26jxuGv6mU i5xS1Bt6EuRFtulJK9isHDHb0dzgBX4gKg/nGrDQtdvS5tEOZG7qOc1zrmAKOzizSH40 62hIC6PJDXC3M8BCSXyzu4fL2wfPlZe+zWniGUTcSz3tIvdcNbjgslndFNpeaA1mAqtp hEhvrg7Wu94RBOmWOnbKw7hh3X0eraRk0Dd1FeiNVQuq/6gKSzDYQLqiRQ9KsNjuNjoq Pyj09mi6LEv4fVswvkzzQJleFGMAxipT408C4fA++cwRrP3RabMGcUQH1K0l/KvpBDj/ jByQ== 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:date:message-id:mime-version; bh=hXRqEYfc4fYUePT5VGlWMSsNoUZahZ3UX7VY12xoF44=; b=vi3589x3FOFT36VbVN4cEqOafWmz18Zx9J8S8TsZzQBZ6zuC4fheeMnN4qPVPMmNFh mda9v3NPjedLBLCyvFoS8wgctD+AztQWtSEJIIRrBYPu2tgnMQAi+Lkh8aV9O4Tnk6PW bKW5JC9ywkg00cW26XFEGHohh+iFCmiT15H8Xtn7S5gPhfzhQ60+wwpXs9bSqxhF6Pz8 MHsIwEn6MSubdx6MgYQO2Ri0WBK0Q6dRi/nhDuR/CT6zUHwrWYZlsfp7EBq+wS/rMm7I wwwrzGUBjMv/1jPxQwUPS2BfjhH4V9DJP/pYCkbFlpxF2wS7/1hMmEm46P/iYi0NAytq LqjQ== X-Gm-Message-State: AOAM533LQC3jc+ZK9X9dJ/aGjdsNWagFLbBOX9PdtN7TFNZ7XtZDDL+G +1+ewDymrEIHObN9vyKvATE= X-Google-Smtp-Source: ABdhPJx58Tm+aCT2YpcizCAX2907MQgKbLGFtK/RG4L+/pHpQckw7ssHytNpJtLfrktY+++tNUOc3g== X-Received: by 2002:a05:6000:15c7:: with SMTP id y7mr2072130wry.424.1639005030370; Wed, 08 Dec 2021 15:10:30 -0800 (PST) Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id e7sm5388199wrg.31.2021.12.08.15.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Dec 2021 15:10:29 -0800 (PST) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Date: Thu, 09 Dec 2021 00:10:28 +0100 Message-ID: <87pmq666cb.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::436 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=kevin.legouguec@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, In Emacs 27.2, M-x run-python did two things that Emacs 28 no longer does. From emacs -Q: (1) M-x run-python Problem 1: 27.2 makes the Python buffer current; 28 does not. (2) Additional step for Emacs 28, to get to the *Python* buffer: C-x o (3) M-x bury-buffer (4) M-x run-python Problem 2: 27.2 raises the Python buffer; 28 does not. (The latter might seem like a niche corner case; it's actually a very convenient feature of python.el's C-c C-p, IMO) The current code in python.el fails on two fronts, AFAICT: (1) the set-buffer clause near the end of run-python is ineffectual, because, as the docstring says: > This function does not display the buffer, so its effect > ends when the current command terminates. Use =E2=80=98switch-to-buffer= =E2=80=99 or > =E2=80=98pop-to-buffer=E2=80=99 to switch buffers permanently. (2) the (when show (display-buffer buffer)) form in python-shell-make-comint is not evaluated when the *Python* buffer already exists, because of it is guarded by (when (not (comint-check-proc proc-buffer-name)) =E2=80=A6). I've bisected this; the "faulty" commit (2020-11-09 "Make the SHOW parameter work again in `run-python'" (0d9e2b80d8)) was itself fixing a regression. Trying to build on top of it, I propose the attached patch. (No changelog entry, because I'm not sure it's the right way to solve this) WDYT? In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, c= airo version 1.16.0) of 2021-12-06 built on amdahl30 Repository revision: 4434deaee2aa9d8c6b9631690c6376f78a9b057f Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101001 System Description: openSUSE Tumbleweed Configured using: 'configure --with-xwidgets --with-cairo --with-gconf --with-xinput2' Configured features: ACL CAIRO DBUS FREETYPE GCONF GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dlocal locale-coding-system: utf-8-unix --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=run-python.patch diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 47d8d1ce8e..aee89f6519 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2996,8 +2996,8 @@ python-shell-make-comint (mapconcat #'identity args " "))) (with-current-buffer buffer (inferior-python-mode)) - (when show (display-buffer buffer)) (and internal (set-process-query-on-exit-flag process nil)))) + (when show (pop-to-buffer proc-buffer-name)) proc-buffer-name)))) ;;;###autoload @@ -3029,7 +3029,6 @@ run-python (python-shell-make-comint (or cmd (python-shell-calculate-command)) (python-shell-get-process-name dedicated) show))) - (set-buffer buffer) (get-buffer-process buffer))) (defun run-python-internal () --=-=-=-- From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Dec 2021 12:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Cc: 52380@debbugs.gnu.org Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.163913798527699 (code B ref 52380); Fri, 10 Dec 2021 12:07:01 +0000 Received: (at 52380) by debbugs.gnu.org; 10 Dec 2021 12:06:25 +0000 Received: from localhost ([127.0.0.1]:45757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvefR-0007Ch-B6 for submit@debbugs.gnu.org; Fri, 10 Dec 2021 07:06:25 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvefN-0007CO-8I for 52380@debbugs.gnu.org; Fri, 10 Dec 2021 07:06:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=GKvPguULyEzztu+LRDicNdVDqLLIXx3OyEZJxy0Fs/w=; b=ca8AgshmzZH+EsQA23yjCR5f/t UVCGURElr5XlnoThVsUWzdW4V9b7wwGOHr2VAdnhpxJsdHYuHiOAF9a8nKJ6gsQcuIGVScwlDcj1/ WirRnVI8Is5KkW31modlynPDnksU+9cYK4awhofEiODiEHpYYtR5mALlKO4wgAuFkM40=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvefE-0002vz-CK; Fri, 10 Dec 2021 13:06:14 +0100 From: Lars Ingebrigtsen References: <87pmq666cb.fsf@gmail.com> X-Now-Playing: The Smiths's _Hatful Of Hollow_: "Handsome Devil" Date: Fri, 10 Dec 2021 13:06:11 +0100 In-Reply-To: <87pmq666cb.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Thu, 09 Dec 2021 00:10:28 +0100") Message-ID: <874k7gzmto.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec writes: > I've bisected this; the "faulty" commit (2020-11-09 "Make the SHOW > parameter work again in `run-python'" (0d9e2b80d8)) was itself fixing a > regression. Trying to build on top of it, I propose the [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) K=C3=A9vin Le Gouguec writes: > I've bisected this; the "faulty" commit (2020-11-09 "Make the SHOW > parameter work again in `run-python'" (0d9e2b80d8)) was itself fixing a > regression. Trying to build on top of it, I propose the attached patch. > (No changelog entry, because I'm not sure it's the right way to solve > this) > > WDYT? Makes sense to me; pushed to emacs-28. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 10 07:06:29 2021 Received: (at control) by debbugs.gnu.org; 10 Dec 2021 12:06:29 +0000 Received: from localhost ([127.0.0.1]:45760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvefV-0007Cz-HP for submit@debbugs.gnu.org; Fri, 10 Dec 2021 07:06:29 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvefT-0007CY-Cm for control@debbugs.gnu.org; Fri, 10 Dec 2021 07:06:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZYk52SDawiLwWEXzfL51Mf9UUKTIwQaNz0eiw5S1qq0=; b=ReVVuu29NGCynchj442lFWZGfm jWu82lrCvuxCDdT6IyVEEg9Qx9a6M9bPt7XfCfbu8zqJ+u8HjDbPNPTnP+zAoRwmEZX7/ZqAD8CGb 4eD1R5c29aiCHVmwKO0CmuPaHnqeipoExaTlJYd/cKh8rHw7wKnze/Y1f5ENjYO5D5rE=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvefL-0002w7-K4 for control@debbugs.gnu.org; Fri, 10 Dec 2021 13:06:21 +0100 Date: Fri, 10 Dec 2021 13:06:17 +0100 Message-Id: <8735n0zmti.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #52380 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 52380 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 52380 29.1 quit From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Dec 2021 12:09:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Cc: 52380@debbugs.gnu.org Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.163913809627964 (code B ref 52380); Fri, 10 Dec 2021 12:09:03 +0000 Received: (at 52380) by debbugs.gnu.org; 10 Dec 2021 12:08:16 +0000 Received: from localhost ([127.0.0.1]:45775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvehE-0007Gy-K2 for submit@debbugs.gnu.org; Fri, 10 Dec 2021 07:08:16 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvehD-0007Gi-8p for 52380@debbugs.gnu.org; Fri, 10 Dec 2021 07:08:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Kp1DlDclZIQ03q/eiAqPl8eWNB5YSzLQN/ziG5oYiso=; b=IJnrQ5YRIx9nsoH+IJWXLk19I/ SC5zJCu6epiAKLRyxFRFqqKvVgryfB+xqAV/cs5zxdNDYzWtBaNVsH9Sd2UKu5x9MSSOKCT+zFZye u6hCidwgfI0JBLRd6JHyS+2M7Ytlkli2gaeoTgvhgRBXyy9Y0TvsUA7XFmpC0p3oiAa4=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mveh4-0002wh-CS; Fri, 10 Dec 2021 13:08:09 +0100 From: Lars Ingebrigtsen References: <87pmq666cb.fsf@gmail.com> <874k7gzmto.fsf@gnus.org> X-Now-Playing: The Smiths's _Hatful Of Hollow_: "Handsome Devil" Date: Fri, 10 Dec 2021 13:08:04 +0100 In-Reply-To: <874k7gzmto.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 10 Dec 2021 13:06:11 +0100") Message-ID: <87y24sy863.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: 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? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 10 07:08:37 2021 Received: (at control) by debbugs.gnu.org; 10 Dec 2021 12:08:37 +0000 Received: from localhost ([127.0.0.1]:45787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvehZ-0007I0-BD for submit@debbugs.gnu.org; Fri, 10 Dec 2021 07:08:37 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvehX-0007HU-PT for control@debbugs.gnu.org; Fri, 10 Dec 2021 07:08:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=VmRnVV+8Y2NxPSGljseqCJXO4aNf9eWYJcoDbHp2lkQ=; b=qyReCT2vm6An3nLQMj2jJxY7aC 8sCdRl2iw6z77wYRyYB9NKePbMHBVF3Xptjtp2Xm1C28CXYHFSGWgJ3iS7qtSCWye7/1gdeY2+IWo JpuKPf4mfHPxAb4jlmM5ICHMpossvO1DMycoQA4yLIdYddmARJFrW6U0acbMoaN5K6gk=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvehQ-0002wv-0e for control@debbugs.gnu.org; Fri, 10 Dec 2021 13:08:30 +0100 Date: Fri, 10 Dec 2021 13:08:26 +0100 Message-Id: <87v8zwy85h.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #52380 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: reopen 52380 tags 52380 - fixed patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) reopen 52380 tags 52380 - fixed patch quit From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Dec 2021 19:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 52380@debbugs.gnu.org Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.16391644084992 (code B ref 52380); Fri, 10 Dec 2021 19:27:02 +0000 Received: (at 52380) by debbugs.gnu.org; 10 Dec 2021 19:26:48 +0000 Received: from localhost ([127.0.0.1]:47927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvlXb-0001IS-MS for submit@debbugs.gnu.org; Fri, 10 Dec 2021 14:26:47 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:39782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvlXX-0001ID-67 for 52380@debbugs.gnu.org; Fri, 10 Dec 2021 14:26:47 -0500 Received: by mail-wm1-f49.google.com with SMTP id n33-20020a05600c502100b0032fb900951eso9740077wmr.4 for <52380@debbugs.gnu.org>; Fri, 10 Dec 2021 11:26:43 -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=BezIhhxLk30z9rWXosw+9lRi6cilkEk1ybZosHvVWg4=; b=Nh+xpYOftbbYOXQjWo3cNrG5+hXNepH66ZTh571e9GSijYBJdg14t426WLQD8aFa76 QcTe3Bne8xXDEhiU5kzY3x5tXrre3m9YU2jbRx1u4O0QF9tJXgJAY1TMC9pkt39TodMe uAqbPK6Qj7UJyUyADJysX9dVpnD6JVJG0EFnfmNZt8v9cMbQnUfhoay17raSF5fblKeF b2wJz60nvSjqkYlL8FRcgEW1DcigJnmZuAp1v2q4LRsW87Y9+rlAZxloo+FOX5tTxePX zxJ2wHKp4yYaDHgTBbhcI1D0YjYcISAig/9trn1KE1WHtkZcmfCn//tdyRJ7S5+UrCUr k7rg== 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=BezIhhxLk30z9rWXosw+9lRi6cilkEk1ybZosHvVWg4=; b=boyyvKTtjHosDUaKkP9PsiWwOFHU/8gw4QFw5/Lb0um7cOl6UOtvxAru599+iYlcrN pkOICA8RfTptov7UGG5rWfAj2FIvqWjkLWc6PUJX49e6MxfFgqUnGha5In2ZyY7DmCZ3 wB+42AHHRKomLerWMDeQ8eiR1kzLRTVsHCuKncfKNIU0Tqs6Im+CurpdDEr/J/eHCLqK v93ygbPIU/J0ZSVscQc+2MWaBkL02buZet5kfhJYZQnincRPkeDCVj1AK4V+H1nQhDJG NfWAy7Ms7efBjlsAPXNnDSm3Ex2khQ2mnjH4ci4pt5glH3a+9kQi7+cBosWR4PVfeUW9 nqKw== X-Gm-Message-State: AOAM533+/l7AFcT0iKdKwInugyWAgdtAGctEeQAS6LbwL1Mr5as9hw+i bIt6U4pnFIaRVT6654lXGhvKwwpJH0A= X-Google-Smtp-Source: ABdhPJzdmGXBsLGitD+A6Bp5Rzgxo3E4f9JeT2UDPh5x1JaGMWBvgkz9ThnJUBbf/wd8UyaVQ/uEFg== X-Received: by 2002:a1c:98ca:: with SMTP id a193mr19271147wme.162.1639164395876; Fri, 10 Dec 2021 11:26:35 -0800 (PST) Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id z15sm3219430wrr.65.2021.12.10.11.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 11:26:35 -0800 (PST) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec References: <87pmq666cb.fsf@gmail.com> <874k7gzmto.fsf@gnus.org> <87y24sy863.fsf@gnus.org> Date: Fri, 10 Dec 2021 20:26:34 +0100 In-Reply-To: <87y24sy863.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 10 Dec 2021 13:08:04 +0100") Message-ID: <87a6h89s7p.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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? 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 =F0=9F=98=92 From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: ERT, buffers and windows (was: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter) Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Dec 2021 20:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 52380@debbugs.gnu.org Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.16391669809078 (code B ref 52380); Fri, 10 Dec 2021 20:10:02 +0000 Received: (at 52380) by debbugs.gnu.org; 10 Dec 2021 20:09:40 +0000 Received: from localhost ([127.0.0.1]:47952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvmD6-0002MM-1R for submit@debbugs.gnu.org; Fri, 10 Dec 2021 15:09:40 -0500 Received: from mail-wr1-f46.google.com ([209.85.221.46]:38839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvmD3-0002M7-Es for 52380@debbugs.gnu.org; Fri, 10 Dec 2021 15:09:39 -0500 Received: by mail-wr1-f46.google.com with SMTP id q3so16802978wru.5 for <52380@debbugs.gnu.org>; Fri, 10 Dec 2021 12:09:37 -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=t5+CPiUupsQxgQfo3gx7q7ZCz5PZYd8RrXZqD9jIQJI=; b=BFdUJME00TWPh2ZA/+rIZHQMNvteRArdEMja3Phu2odzxS5/YUtOVTZbzo1hZ7tu7E wDv5GpM33AGeJg1IyUc01JAH6Jowd8Ma5j5sOxtu0BYRTxsbscfHFzfMragkshkvOk2m ZHyk3M2ufhz/epxdk0LEjiQUQh9foSp9HI/1ZoxCNgYKre4F7APOGEiz7XfrHHiZ6AT+ HpMhwAk5uN0OKXJU33alZ9vQOYLjT1N28v7+oRDg5V84FSfudUheku4DIYJVDp2Gljjz cd6aeJYWk8juSSNR9jsQ6j5t3669txngtFY0oFTWUCLMNS8BQT4ibGz/5Oy81fASElUI Bx9w== 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=t5+CPiUupsQxgQfo3gx7q7ZCz5PZYd8RrXZqD9jIQJI=; b=VmAPkFrnhjRwqcOAuqJynLP6vOnKIOPwCK7ZTPl1DeA36bykdI1Ec5TmYEXeNXDgy7 N863Ew6IOe5ERFWJ8QTDRhX2r3cO/p8xD1GURdJfCreCILbUWDe/4709aufVtQd8y1WW elFks6U2eJNh8/ea8dRxDlbGPJZiMloHPmfDuv3x2aCJevK9RDS/z18hPlJGQOo3LtZ+ QZYaq0uoap4FdPYiO0Ux5c6pS0OqaDuqAG1Hk2aGbFzbpYNV7GVObj7K9lWpdHPV3fF/ MBt9bzdxH18Rt9OfeOVr7pUrp/J3WgiVxAE9+3rf1PT8HzHELTaByi+E9Au9JLH0V0F8 PkWA== X-Gm-Message-State: AOAM533SFh2xU1z/lWAjEQEzC07OG28ezQxUfdIduR3MpZCoLSC8GJAp MuD0IImS0aUP+CEANOJO165uNoI080A= X-Google-Smtp-Source: ABdhPJylCYpTFVbDFU2auRs445gv7YbKG+30os/WZcXoHSyMrPpMQ9kmbChM3wb82hD9/xwzQb3Liw== X-Received: by 2002:a05:6000:1c8:: with SMTP id t8mr934831wrx.542.1639166971066; Fri, 10 Dec 2021 12:09:31 -0800 (PST) Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id t16sm3259796wrn.49.2021.12.10.12.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 12:09:30 -0800 (PST) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec References: <87pmq666cb.fsf@gmail.com> <874k7gzmto.fsf@gnus.org> <87y24sy863.fsf@gnus.org> <87a6h89s7p.fsf@gmail.com> Date: Fri, 10 Dec 2021 21:09:30 +0100 In-Reply-To: <87a6h89s7p.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Fri, 10 Dec 2021 20:26:34 +0100") Message-ID: <875yrw9q85.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) K=C3=A9vin Le Gouguec writes: > 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? > > 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 =F0=9F=98=92 If I amend the test as follows: diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/pyth= on-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) =E2=80=A6 then (should (eq (get-buffer-window buffer) (selected-window))) passes, but (should (eq buffer (current-buffer))) does not. Does that make sense to anyone? From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: ERT, buffers and windows (was: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Dec 2021 20:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Cc: larsi@gnus.org, 52380@debbugs.gnu.org Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.163916827311093 (code B ref 52380); Fri, 10 Dec 2021 20:32:02 +0000 Received: (at 52380) by debbugs.gnu.org; 10 Dec 2021 20:31:13 +0000 Received: from localhost ([127.0.0.1]:47978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvmXw-0002sq-OW for submit@debbugs.gnu.org; Fri, 10 Dec 2021 15:31:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvmXu-0002se-9Y for 52380@debbugs.gnu.org; Fri, 10 Dec 2021 15:31:11 -0500 Received: from [2001:470:142:3::e] (port=47526 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvmXo-0003le-UK; Fri, 10 Dec 2021 15:31:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=pOLQugV+4R8LIEeV2Jqw9zXY3yzNY1EytGyPoasEINM=; b=aDkGweAMkP28edIoXlhg EDali2/0rhut1sFDR1KPfL13YkRuxCKxQ+rTVxJBeXoaagGGMjPm+cL2CAJp0YWlAHeFV8aBeAXYi u5HwN4pNEz+kKizdMJrTYKoL9qk0eQmOvUujY1qdWTz2uLG6fmx+jZbGyH9NjF7xkK2EJTq1/+zDf fgPFpiDRdii9bGA7jyBoKlZ4O/jXkMFI7oOqPviSMhbH6W8JJWQac4Dg5Z3rcWi6ZnruMoShH3jo/ cbfeljX9qo5Q4gR/hvLI7isYDUiZiT2jMgImztF8a46QumCjecG8PbsSTV0TwjQ9YFLdC94BnoeWd cnBqITRh5zX6iw==; Received: from [87.69.77.57] (port=2973 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvmXo-0008F8-Ng; Fri, 10 Dec 2021 15:31:05 -0500 Date: Fri, 10 Dec 2021 22:30:50 +0200 Message-Id: <831r2krymd.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <875yrw9q85.fsf_-_@gmail.com> (message from =?UTF-8?Q?K=C3=A9vin?= Le Gouguec on Fri, 10 Dec 2021 21:09:30 +0100) References: <87pmq666cb.fsf@gmail.com> <874k7gzmto.fsf@gnus.org> <87y24sy863.fsf@gnus.org> <87a6h89s7p.fsf@gmail.com> <875yrw9q85.fsf_-_@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Kévin Le Gouguec > Date: Fri, 10 Dec 2021 21:09:30 +0100 > Cc: 52380@debbugs.gnu.org > > 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? You assume that the selected window always shows the current buffer? That's not in general true. From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: ERT, buffers and windows Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Dec 2021 20:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: larsi@gnus.org, 52380@debbugs.gnu.org Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.163916990813714 (code B ref 52380); Fri, 10 Dec 2021 20:59:02 +0000 Received: (at 52380) by debbugs.gnu.org; 10 Dec 2021 20:58:28 +0000 Received: from localhost ([127.0.0.1]:48014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvmyK-0003Z8-GH for submit@debbugs.gnu.org; Fri, 10 Dec 2021 15:58:28 -0500 Received: from mail-wr1-f52.google.com ([209.85.221.52]:46007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvmyG-0003Yr-MS for 52380@debbugs.gnu.org; Fri, 10 Dec 2021 15:58:27 -0500 Received: by mail-wr1-f52.google.com with SMTP id o13so16949970wrs.12 for <52380@debbugs.gnu.org>; Fri, 10 Dec 2021 12:58:24 -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=7/uwLViLKrRoZjLsjzDiXwjMjzMAGjkmULUyUkphH3c=; b=Bdvasq6zoHQaW1T2Rhk+AS8NZYce1m79ncvuJR6G72o+/q7nw2ggGsozJAELnzzXF7 WuE/1b4QwNHRc2M9trctLcSPWfKkpuzW5383+h5FLbMFLh2bK47pk544IvW8Iyqn8a8y FUbBTkV6ZvA4IM8pYay2d0Vc+UUCiNXvAfLA9IhzAQ5uhyIzWvGTk9tBpSwyPoxhE8hL DyByMNQCSUkAudBqInVNEG0mFkjwIKIkW1y4ZAt/XdlVfRZbI29Pt4c8MOACg4bqwC5I mTwl4SL5gUZ6hmjdVL7S1LpiUxmoFxGLaSq85SEYXjI3aFZ4Asch3ihdnWYgJknaNTha 1+ww== 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=7/uwLViLKrRoZjLsjzDiXwjMjzMAGjkmULUyUkphH3c=; b=bc64ImteP/JP69bYQjCI9ESn12ZmBAxsHSvKzqWQhOhGADhYyxzkYCyUd2bEBAPatm 3CpNxOjheXkWY7/IAWtwaXdVj9Ghr7TmzHzdiHe9of6TyBZ2G0urCiuidwCQHX1MWTxI RoAx4pbZUzxQ8GmJFpdM0BufiZEtfD917gDSlgCwUgoUI8L0U12U1b6hd92751TnYBef 1EHuN7l5xa2YfUg32v8GC7lsLbcGBkc9hhKQa0Y7lqDqFypfIakywgHW9/G3eG4CWBuj kjdtJu3YWSPsOfa9FuT6DE/CcR0QSUl5aKVoZ7NmSMRXoaJdIrTNmC6u91rT+1CeeN92 lL6w== X-Gm-Message-State: AOAM531hEC4Sv+Ue2LZzs6BE7pzPExwEDLchGlmR/gi220dOBxV+Nqir 3Q91A7Fm62u0T5FIl6491khCYA3NH4w= X-Google-Smtp-Source: ABdhPJwu5W/U5XdzIO9WOMKgmRdt4Uip1KnNwbciemI0/xbgFRewPc5M0I3UFZ/F9xeIGiRewpsSwg== X-Received: by 2002:adf:8165:: with SMTP id 92mr17604319wrm.199.1639169898595; Fri, 10 Dec 2021 12:58:18 -0800 (PST) Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id u23sm3674653wru.21.2021.12.10.12.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 12:58:18 -0800 (PST) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec References: <87pmq666cb.fsf@gmail.com> <874k7gzmto.fsf@gnus.org> <87y24sy863.fsf@gnus.org> <87a6h89s7p.fsf@gmail.com> <875yrw9q85.fsf_-_@gmail.com> <831r2krymd.fsf@gnu.org> Date: Fri, 10 Dec 2021 21:58:16 +0100 In-Reply-To: <831r2krymd.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 10 Dec 2021 22:30:50 +0200") Message-ID: <871r2k9nyv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: K=C3=A9vin Le Gouguec >> Date: Fri, 10 Dec 2021 21:09:30 +0100 >> Cc: 52380@debbugs.gnu.org >>=20 >> If I amend the test as follows: >>=20 >> diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/p= ython-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) >>=20 >> =E2=80=A6 then (should (eq (get-buffer-window buffer) (selected-window))) >> passes, but (should (eq buffer (current-buffer))) does not. Does that >> make sense to anyone? > > You assume that the selected window always shows the current buffer? > That's not in general true. Mmm, thanks. I see that "(elisp) Current Buffer" has things to say on the subject: > When an editing command returns to the editor command loop, Emacs > automatically calls =E2=80=98set-buffer=E2=80=99 on the buffer shown in t= he selected > window (*note Selecting Windows::). In the context of ERT, what would be the correct way to test that after calling M-x run-python (=E2=89=A1 (run-python nil nil 'show)), the *Python* buffer is visible, and its window is selected? Should we just disregard (current-buffer) when writing ERT tests, and assert things in terms of (selected-window)? Or is there a way to make ERT "return to the editor command loop", thereby selecting the buffer shown in the selected window? From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter 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 X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 52380@debbugs.gnu.org Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.163926140614507 (code B ref 52380); Sat, 11 Dec 2021 22:24:01 +0000 Received: (at 52380) by debbugs.gnu.org; 11 Dec 2021 22:23:26 +0000 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 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 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) 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) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec References: <87pmq666cb.fsf@gmail.com> <874k7gzmto.fsf@gnus.org> <87y24sy863.fsf@gnus.org> Date: Sat, 11 Dec 2021 23:23:15 +0100 In-Reply-To: <87y24sy863.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 10 Dec 2021 13:08:04 +0100") Message-ID: <87pmq2233g.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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". From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: 28.0.50; [PATCH] run-python no longer focuses interpreter Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Dec 2021 06:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Cc: 52380@debbugs.gnu.org Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.163929122030547 (code B ref 52380); Sun, 12 Dec 2021 06:41:01 +0000 Received: (at 52380) by debbugs.gnu.org; 12 Dec 2021 06:40:20 +0000 Received: from localhost ([127.0.0.1]:50525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwIWy-0007wd-GP for submit@debbugs.gnu.org; Sun, 12 Dec 2021 01:40:20 -0500 Received: from quimby.gnus.org ([95.216.78.240]:45482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwIWw-0007wN-7C for 52380@debbugs.gnu.org; Sun, 12 Dec 2021 01:40:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=DUPbQ8gtmdxOzyS+96dBMMgPlHY5Y4jNoJxJRmuIIYc=; b=EZHcpOcJhxeiKzP99cC9ljHVRC of/SuJoAiH1DaQnPJTNTe4KSQ9Ll7pSAxaWatJjrSYor0cdzq558lFemZP1ks3l6XOIkdlcijFL1W w5ZKPNTFqtd7VZC4QWp5r+zPrLddDKGGWIk41vxwezXhaAw6oTaWYyumt0UOmhSuOwPU=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mwIWn-0002nj-FQ; Sun, 12 Dec 2021 07:40:12 +0100 From: Lars Ingebrigtsen References: <87pmq666cb.fsf@gmail.com> <874k7gzmto.fsf@gnus.org> <87y24sy863.fsf@gnus.org> <87pmq2233g.fsf@gmail.com> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAAAAAByaaZbAAAAAXNSR0IArs4c6QAAAAJiS0dE AP+Hj8y/AAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH5QwMBic6HT9lTQAAAJhJREFUSMft k9ENgCAMRIGwkqPclF3KUfzBQC3aw/ihwX4R0tdryxHXMBZpMH9OIAeUk3BAXOqZQlqgIXBaQQF7 BjolyKFhLrRCCGKSRPNDa0WnJSgBsV2lXpWrgZyWrETml4R+Sx7Gb6lgiTEQGo3jw7nxwh9344tS UU3MKTSmJxXqQzw/tGgBFzDOcRUwChxjSvP9wEeBDeQcFNLrTcmuAAAAJXRFWHRkYXRlOmNyZWF0 ZQAyMDIxLTEyLTEyVDA2OjM5OjU4KzAwOjAwtHwDsAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0x Mi0xMlQwNjozOTo1OCswMDowMMUhuwwAAAA4dEVYdGljYzpjb3B5cmlnaHQAQ29weXJpZ2h0IChj KSAxOTk4IEhld2xldHQtUGFja2FyZCBDb21wYW55+Vd5NwAAACF0RVh0aWNjOmRlc2NyaXB0aW9u AHNSR0IgSUVDNjE5NjYtMi4xV63aRwAAACZ0RVh0aWNjOm1hbnVmYWN0dXJlcgBJRUMgaHR0cDov L3d3dy5pZWMuY2gcfwBMAAAAN3RFWHRpY2M6bW9kZWwASUVDIDYxOTY2LTIuMSBEZWZhdWx0IFJH QiBjb2xvdXIgc3BhY2UgLSBzUkdCRFNIqQAAAABJRU5ErkJggg== X-Now-Playing: Lost Girls's _Menneskekollektivet_: "Menneskekollektivet" Date: Sun, 12 Dec 2021 07:40:08 +0100 In-Reply-To: <87pmq2233g.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Sat, 11 Dec 2021 23:23:15 +0100") Message-ID: <87lf0qe37b.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec writes: > 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* [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) K=C3=A9vin Le Gouguec writes: > 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. Sounds good to me. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: 28.0.50; [PATCH v2] run-python no longer focuses interpreter Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Dec 2021 14:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 52380@debbugs.gnu.org Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.163931783419842 (code B ref 52380); Sun, 12 Dec 2021 14:04:02 +0000 Received: (at 52380) by debbugs.gnu.org; 12 Dec 2021 14:03:54 +0000 Received: from localhost ([127.0.0.1]:50971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwPSD-00059x-L7 for submit@debbugs.gnu.org; Sun, 12 Dec 2021 09:03:53 -0500 Received: from mail-wr1-f42.google.com ([209.85.221.42]:33427) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwPSB-00059k-H7 for 52380@debbugs.gnu.org; Sun, 12 Dec 2021 09:03:52 -0500 Received: by mail-wr1-f42.google.com with SMTP id d24so23000859wra.0 for <52380@debbugs.gnu.org>; Sun, 12 Dec 2021 06:03:51 -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; bh=Eb0+4QgQL7FC/myHzQz8FiZQExj7R/Hx+sCGkdgQhfQ=; b=WKAY4xWr8hTyyShBXKAd2H15+Cu2TlfH2sbSsUU/clxAZgAv7BtyZP0/FwH5LRSdNJ xdw0c234nZrq+4e3v2WhXdYHji9xvlnUxEDfo60LCCBBJbXZojJFYH1osRXpt4wI+kpO x7DSxqy4nPC41tEurbgKq+OIqCbrnqGQ35Nb/IUaUqpwKw/rXOuFW0HGlc/Q0E+t476E JcJHcCsnB14kcFouI8ZYHmsVQjX9trNyQcXGnKgmQ1af4oBSwTtm46kMk5sdjUgjcE3A /HT2D2i9EnWOV5SyQRmEQghIdYdEzt0ozYkLBhPg5ZI1fL+Y9uG5GMmiOqes7wD1n9fc pVhQ== 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; bh=Eb0+4QgQL7FC/myHzQz8FiZQExj7R/Hx+sCGkdgQhfQ=; b=KECv++A1R7SLVkiPIoTMfpWZYc78MTd9zu02NU80Z4PEHnCP+Ax55rTR/KgelnwxZP jmYxUDVu1/y7lLeOhBQ8F9nGHbvJ9TaZINltSeeluH1d19CyP+ahHreqlKFrONOiTAAa ICJGYDsuYL44zyl7YcXHsWKlK8R41T74ZhjbkKWdRPLHXymOEascUJE+kWi4QStcj5vE RFQtGs3VSD7hl6T55TEiklgBQOQoJLO9ta+LhKXtXRUiezzire1KCH8tRLvnjNvJSH7x rZqL/ecQyQtqOOTFZ791RvspD1c48rXLewdsF7RdkhOJOC/fQGEW+mm+hDd2uACBt5k1 IWnA== X-Gm-Message-State: AOAM531U4+/kY/+YcaP8k9EO2VzWa/faI22bHg0O4Oez10yQ9kA9DCiA RUs7m8BSDn5HwMi3SeZIa+N4BER2Zpg= X-Google-Smtp-Source: ABdhPJzLYfPG2EnuJ98p1xITj9QyCUbvI0akerQHR63vAi4v4jSCA5V5cxpJ1o6xcqxYcfGHtKJn8g== X-Received: by 2002:adf:efc6:: with SMTP id i6mr25294867wrp.428.1639317825330; Sun, 12 Dec 2021 06:03:45 -0800 (PST) Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id y15sm10863020wry.72.2021.12.12.06.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Dec 2021 06:03:44 -0800 (PST) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec References: <87pmq666cb.fsf@gmail.com> <874k7gzmto.fsf@gnus.org> <87y24sy863.fsf@gnus.org> <87pmq2233g.fsf@gmail.com> <87lf0qe37b.fsf@gnus.org> Date: Sun, 12 Dec 2021 15:03:43 +0100 In-Reply-To: <87lf0qe37b.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 12 Dec 2021 07:40:08 +0100") Message-ID: <87sfuxor7k.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Lars Ingebrigtsen writes: > K=C3=A9vin Le Gouguec writes: > >> 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. > > Sounds good to me. Alright, here goes; after reviewing the original bug#31398 report, I also took the liberty of adjusting the test name, commentary and docstring. It'd be great if the rationale bit of the commit message made it in =F0=9F= =99=8F --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Make-M-x-run-python-select-the-window-again.patch >From 9b61be086d9651a9f07962e20a1f5e09cd46f1f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Sun, 12 Dec 2021 12:24:24 +0100 Subject: [PATCH] Make `M-x run-python' select the window again Interactively, we want M-x run-python to focus the interpreter buffer. The previous code failed in two ways: - the call to 'display-buffer' was not reached if an interpreter was already running, - set-buffer is ineffectual if the interpreter's window is not selected: once Emacs returns to the command loop, the current buffer will revert back to what the selected window contains. * lisp/progmodes/python.el (python-shell-make-comint): Handle the SHOW argument regardless of whether an interpreter buffer exists, and use pop-to-buffer to select the window. (run-python): Delegate buffer management to 'python-shell-make-comint'. * test/lisp/progmodes/python-tests.el (python-tests--run-python-selects-window): Rename from 'python-tests--bug31398', and adjust assertions. --- lisp/progmodes/python.el | 4 ++-- test/lisp/progmodes/python-tests.el | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 47d8d1ce8e..b403de8b7a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2996,8 +2996,9 @@ python-shell-make-comint (mapconcat #'identity args " "))) (with-current-buffer buffer (inferior-python-mode)) - (when show (display-buffer buffer)) (and internal (set-process-query-on-exit-flag process nil)))) + (when show + (pop-to-buffer proc-buffer-name)) proc-buffer-name)))) ;;;###autoload @@ -3029,7 +3030,6 @@ run-python (python-shell-make-comint (or cmd (python-shell-calculate-command)) (python-shell-get-process-name dedicated) show))) - (set-buffer buffer) (get-buffer-process buffer))) (defun run-python-internal () diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 15bda5c197..2d1ccdca41 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -5449,15 +5449,21 @@ python-tests--python-nav-end-of-statement--infloop (python-nav-end-of-statement))) (should (eolp)))) -;; After call `run-python' the buffer running the python process is current. -(ert-deftest python-tests--bug31398 () - "Test for https://debbugs.gnu.org/31398 ." +;; Interactively, `run-python' focuses the buffer running the +;; interpreter. +(ert-deftest python-tests--run-python-selects-window () + "Test for bug#31398. See also bug#44421 and bug#52380." (skip-unless (executable-find python-tests-shell-interpreter)) - (let ((buffer (process-buffer (run-python nil nil 'show)))) - (should (eq buffer (current-buffer))) + (let* ((buffer (process-buffer (run-python nil nil 'show))) + (window (get-buffer-window buffer))) + ;; We look at `selected-window' rather than `current-buffer' + ;; because as `(elisp)Current buffer' says, the latter will only + ;; be synchronized with the former when returning to the "command + ;; loop"; until then, `current-buffer' can change arbitrarily. + (should (eq window (selected-window))) (pop-to-buffer (other-buffer)) (run-python nil nil 'show) - (should (eq buffer (current-buffer))))) + (should (eq window (selected-window))))) (ert-deftest python-tests--fill-long-first-line () (should -- 2.34.1 --=-=-=-- From unknown Sat Aug 16 19:17:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52380: 28.0.50; [PATCH v2] run-python no longer focuses interpreter Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Dec 2021 04:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Cc: 52380@debbugs.gnu.org Received: via spool by 52380-submit@debbugs.gnu.org id=B52380.163936904921777 (code B ref 52380); Mon, 13 Dec 2021 04:18:02 +0000 Received: (at 52380) by debbugs.gnu.org; 13 Dec 2021 04:17:29 +0000 Received: from localhost ([127.0.0.1]:53576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwcmH-0005fA-6b for submit@debbugs.gnu.org; Sun, 12 Dec 2021 23:17:29 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwcmF-0005en-HX for 52380@debbugs.gnu.org; Sun, 12 Dec 2021 23:17:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ebOnCGlLM3V9THP1LcFu4aX2cQkrhCqRejB66t+Gm6o=; b=ljmjgmx50w3P0vYoxflPq34TGl 5grpgpM0aMo8RGJZ1ES7kdM+2cG5eJ048r1XcVHP7oBH04VqAO/xNeCWbB0InyRgnHfaaEE0AiiSJ jN9HrI0jel7honwi3iXRIb7hV/UZOJl7I+kSPNMk500aKkmog7fYq0Eevfsay1CrsNLM=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mwcm5-0003Qm-Tu; Mon, 13 Dec 2021 05:17:20 +0100 From: Lars Ingebrigtsen References: <87pmq666cb.fsf@gmail.com> <874k7gzmto.fsf@gnus.org> <87y24sy863.fsf@gnus.org> <87pmq2233g.fsf@gmail.com> <87lf0qe37b.fsf@gnus.org> <87sfuxor7k.fsf_-_@gmail.com> X-Now-Playing: Bobbie Gentry's _The Girl From Chickasaw County (6): Fancy_: "Fancy" Date: Mon, 13 Dec 2021 05:17:17 +0100 In-Reply-To: <87sfuxor7k.fsf_-_@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Sun, 12 Dec 2021 15:03:43 +0100") Message-ID: <87o85lrvea.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec writes: > Alright, here goes; after reviewing the original bug#31398 report, I > also took the liberty of adjusting the test name, commentary and > docstring. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) K=C3=A9vin Le Gouguec writes: > Alright, here goes; after reviewing the original bug#31398 report, I > also took the liberty of adjusting the test name, commentary and > docstring. Thanks; pushed to Emacs 28. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 12 23:17:41 2021 Received: (at control) by debbugs.gnu.org; 13 Dec 2021 04:17:41 +0000 Received: from localhost ([127.0.0.1]:53579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwcmT-0005fc-DA for submit@debbugs.gnu.org; Sun, 12 Dec 2021 23:17:41 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwcmR-0005fO-Rj for control@debbugs.gnu.org; Sun, 12 Dec 2021 23:17:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Y6XpZPvTeoK5W5gpdKA3yDGGvMk80PAdELSP7oQR1hI=; b=dYVg9/Nvmy7HkQUqce6bfYPA7y C9hwfN8KlIa3Ntdwls6++MiKBzCqKimTdZVH3zohCozycOTMpGabU/OjJnKErA08vJt2g7zaNFJhm QAZhry/MCXX/1Lg7GcHEeolR/H1gpIGWTEXo4xH6CIJEFClNJsVNha2z6+yeSf2xo4CI=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mwcmJ-0003Qv-Ny for control@debbugs.gnu.org; Mon, 13 Dec 2021 05:17:34 +0100 Date: Mon, 13 Dec 2021 05:17:31 +0100 Message-Id: <87mtl5rvdw.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #52380 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 52380 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 52380 28.1 quit