From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kobarity Newsgroups: gmane.emacs.bugs Subject: bug#70609: 30.0.50; [PATCH] New function 'python-shell-send-block' for python-mode Date: Wed, 01 May 2024 17:15:23 +0900 Message-ID: References: <86zftcqqby.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") 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="38348"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: Eli Zaretskii , 70609@debbugs.gnu.org To: Lin Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 01 10:16:05 2024 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 1s258H-0009mJ-6o for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 May 2024 10:16:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s257v-0004UC-QK; Wed, 01 May 2024 04:15:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s257u-0004Tu-4l for bug-gnu-emacs@gnu.org; Wed, 01 May 2024 04:15:42 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s257t-0000H6-G6 for bug-gnu-emacs@gnu.org; Wed, 01 May 2024 04:15:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s258E-00032g-HM for bug-gnu-emacs@gnu.org; Wed, 01 May 2024 04:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 May 2024 08:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70609 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70609-submit@debbugs.gnu.org id=B70609.171455136111688 (code B ref 70609); Wed, 01 May 2024 08:16:02 +0000 Original-Received: (at 70609) by debbugs.gnu.org; 1 May 2024 08:16:01 +0000 Original-Received: from localhost ([127.0.0.1]:36082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s258C-00032S-O5 for submit@debbugs.gnu.org; Wed, 01 May 2024 04:16:01 -0400 Original-Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:53547) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2587-00032K-Oo for 70609@debbugs.gnu.org; Wed, 01 May 2024 04:15:59 -0400 Original-Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1ec5387aed9so12440075ad.3 for <70609@debbugs.gnu.org>; Wed, 01 May 2024 01:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714551329; x=1715156129; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=hqGpKkjB6/kc6iPf3b56BxprJE6CVwKd3LUgJ5j4e7U=; b=nVGinc6g1pLWPTukkXCoOTN/eeWPPBvDB+wkwtAyx7HE2AyX4aY/wV1B47xtKmyYAM ZqzTjp1dyHkmRFhIAp7OBGNm3Be1vCsnJEbosYcOIrtfOqkr9rgVf5/9QUAyJmSlX759 sfUwPX7ZQfSURVlV3rj5BY26up9mna6S6uck1cq4X8GslFNvD4n3Pq9XUhIKYRRFOBGz wawUXf7gIp6ZoLeMy0sl5G2jGH4FmdZ8oCRvzahZOfF/YMzxttr5hEUpSbylfk7KdJ2x 0W5QXQhXBGDKfUa1PEst6RBesgqpFxi/jFn08Tc1L71APUZVYYv1+Z+b/vn9E/4sRPok Uy4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714551329; x=1715156129; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=hqGpKkjB6/kc6iPf3b56BxprJE6CVwKd3LUgJ5j4e7U=; b=sk1DWw8z0QKfCWhCcniwwc7d1CcqH1Deb7+yHX+AFAhiya17JOf+sTxga8cotIYaD5 B1HZGTcIRQ0FP7LXu8ptaEMtZ9Y+zSbZTc736/eAeoDdCHG0i12TSNdF69A9wDv4X0Gj rSMvj4uzeK4x7O+e8w8bPlH1WPQd+mjVjxUuLF8VkmyT5szg9ngzWKT/kvX+40wVjEM2 HVkbd4wMR5xKKN+0E2ZZRaNpZHVMAe0MZcwZiTFMxTBCKXDqcec8NsMsDt6i6yA+3MMC O+WJlxSRfaNreYbC3qtZZfEzVX2eduWVkPSqcfJ5V98hcQK4nmzRUVK3/NGK5+0XDYXO CiOQ== X-Forwarded-Encrypted: i=1; AJvYcCW7TLIBOoE+2tkfy/HJ2/2FfJ3uJgSlIkXAv0o7Efh+E11nD6aZJlP6Z6abHHoEJr7QS70zAIrkOfC2eO2I9+HjAm4L/WU= X-Gm-Message-State: AOJu0YzGmuAL+SrbD8R3A2XY+8o34hDOeWIWa60sMVq2uQPfDlnmQ/aj LkbfHKEvvkYAPreBzp5io/Fns0mRwpwFeLAKk0OdV4G9j7kKotEO X-Google-Smtp-Source: AGHT+IFsQ5pRk6h1BGnianGG/kV/Lo/DUI/K2bzVFIpWWfkEv9/YtssGi9zAaFchEphLWxw9hZsnVw== X-Received: by 2002:a17:903:2592:b0:1e3:c419:35c2 with SMTP id jb18-20020a170903259200b001e3c41935c2mr1329268plb.34.1714551328669; Wed, 01 May 2024 01:15:28 -0700 (PDT) Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id y22-20020a17090264d600b001ec6db9356bsm1687764pli.204.2024.05.01.01.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 01:15:28 -0700 (PDT) In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284242 Archived-At: Lin Sun wrote: > Hi Kobarity, >=20 > On Tue, Apr 30, 2024 at 7:28=E2=80=AFAM kobarity wro= te: > > > > Eli Zaretskii wrote: > > > > > > > From: Lin Sun > > > > Date: Sat, 27 Apr 2024 14:14:06 +0000 > > > > > > > > Here is a function 'python-shell-send-block' to send a block to the > > > > python interpreter in python mode, it's similar to > > > > `python-shell-send-defun` but works on block. > > > > > > > > The implementation and testing are included in that patch. > > > > > > > > Please help review the changes. > > > > > > > > [PATCH] New function 'python-shell-send-block' for python-mode > > > > > > > > * lisp/progmodes/python.el: Add implemention of the function. > > > > * test/lisp/progmodes/python-tests.el: Test case for the function. > > > > * etc/NEWS: Document for the function. > > > > > > kobarity, any comments? > > > > I think `python-shell-send-block' itself is good, but there may be > > room for improvement in the test case. > > > > It is better not to use f-strings as much as possible because it > > depends on the Python version. > > > > `python-tests-look-at' is basically for moving point. Since it looks > > for the next occurrence of the specified string, it may move the point > > to an unexpected location. For testing, it would be better to use > > `looking-at', etc. or compare the point after moving with > > `python-tests-look-at' to the expected value. > Thanks for the comments and you're right, so I attach the changes to > avoid the python f-string, also using the `looking-at` to do exactly > matching. > Please help review the enhanced testing code. Thanks. Hi Lin, Thanks, it looks good to me.