From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70609: 30.0.50; [PATCH] New function 'python-shell-send-block' for python-mode Date: Thu, 02 May 2024 13:05:38 +0300 Message-ID: <86sez0lea5.fsf@gnu.org> References: <86zftcqqby.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26097"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70609-done@debbugs.gnu.org, kobarity@gmail.com To: Lin Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 02 12:06:59 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 1s2TL8-0006Nx-Rf for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 May 2024 12:06:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2TKt-0005R4-0U; Thu, 02 May 2024 06:06: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 1s2TKr-0005Qg-4f for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 06:06:41 -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 1s2TKq-0002bf-Qy for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 06:06:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s2TLC-0006UZ-AO for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 06:07:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 May 2024 10:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 70609 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 70609@debbugs.gnu.org, eliz@gnu.org, sunlin7.mail@gmail.com Original-Received: via spool by 70609-done@debbugs.gnu.org id=D70609.171464438224932 (code D ref 70609); Thu, 02 May 2024 10:07:02 +0000 Original-Received: (at 70609-done) by debbugs.gnu.org; 2 May 2024 10:06:22 +0000 Original-Received: from localhost ([127.0.0.1]:42810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2TKY-0006U4-9s for submit@debbugs.gnu.org; Thu, 02 May 2024 06:06:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2TKT-0006Tu-F5 for 70609-done@debbugs.gnu.org; Thu, 02 May 2024 06:06:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2TK2-0002YZ-4r; Thu, 02 May 2024 06:05:50 -0400 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=bHWacHONosjJGCHuHRr9osC59lRzl6wFE1nILJkxpjQ=; b=a2Za7O8iusP1JnV2xKqZ ohjECvs3WD/G4J28QRRRIBmjw8VEvnwIeMvgTG2tSQHRLkvYkhHvI9ofxZoVDxH777xaym6wJ9KUH ujB/b1W4ZayNjyZvovD06YmPWW+/lVBn22FXFrekqYZLKdbX8SNQ47JY8C/u2+6X7mwG9/qp7GxvJ dbY67NoDjOKVAl3zU0xlXleYpIzceohfiRKUL0L9xR8g0CsdSdb51/Nvb2tHmcJ5uX3RdbfcCkIy2 YWoWcgzp88hQ7zporsJFkCnzxJHeapvn/uR72yqveSrm4kHVW3OZZ22uvF+EcrfIx0ID+PBlz+yfJ HyxFOVM5UcDwig==; In-Reply-To: (message from Lin Sun on Tue, 30 Apr 2024 15:51:18 +0000) 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:284299 Archived-At: > From: Lin Sun > Date: Tue, 30 Apr 2024 15:51:18 +0000 > Cc: Eli Zaretskii , 70609@debbugs.gnu.org > > Hi Kobarity, > > On Tue, Apr 30, 2024 at 7:28 AM kobarity wrote: > > > > 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. Thanks, installed on master (with some minor changes), and closing the bug.