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#60466: 30.0.50; python-shell-send-region fails when the region starts in the middle of the first line Date: Sat, 07 Jan 2023 10:59:06 +0200 Message-ID: <83cz7qu3dx.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19378"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60466-done@debbugs.gnu.org To: kobarity Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 07 09:59:21 2023 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 1pE52u-0004rK-UP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Jan 2023 09:59:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pE52e-0002s0-B3; Sat, 07 Jan 2023 03:59:04 -0500 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 1pE52c-0002rR-DA for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 03:59:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pE52c-0007Bc-4r for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 03:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pE52b-0000SD-SC for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 03:59:01 -0500 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Jan 2023 08:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 60466 X-GNU-PR-Package: emacs Mail-Followup-To: 60466@debbugs.gnu.org, eliz@gnu.org, kobarity@gmail.com Original-Received: via spool by 60466-done@debbugs.gnu.org id=D60466.16730819331727 (code D ref 60466); Sat, 07 Jan 2023 08:59:01 +0000 Original-Received: (at 60466-done) by debbugs.gnu.org; 7 Jan 2023 08:58:53 +0000 Original-Received: from localhost ([127.0.0.1]:56413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE52T-0000Rm-JG for submit@debbugs.gnu.org; Sat, 07 Jan 2023 03:58:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE52R-0000RZ-Oi for 60466-done@debbugs.gnu.org; Sat, 07 Jan 2023 03:58:52 -0500 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 1pE52M-00078k-CH; Sat, 07 Jan 2023 03:58:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gCVxyMbI6zZ11VcrX6g+Npx1M9v4MroQU6PCP/7JUD0=; b=IQciDSrzEYgD eQFpHvTjPAYbnxA3GWYN3+xsQGI+Qe+As91gZrs1ngw3X/S6TiPrz9M0XHbBHuBkHqxtdMGt8xQhA TwdnK/nYg2EnItPWuHKQshgdTlky6SPvYwdWUSl7hN9UykPWj110oU921D7/rhy9Y9UJJVPNid3eu grGuVvO6lfbVlBhSdsOlNJ++mBdRWs8G6LzK2CAYea2hf2SN8Mb4Vges9QCqkrGwupUybmhJVaGGS MvnJ7kwY7OoFp4/tlrql59xksBwoeiFCl5huKb+YqHwMhFwH4sNQgGA7n7jvWIslN+I1EKPeLCU3w mSQpgCcsf0PsRWmI+UPQrg==; Original-Received: from [87.69.77.57] (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 1pE52L-0005pn-Rh; Sat, 07 Jan 2023 03:58:46 -0500 In-Reply-To: (message from kobarity on Sun, 01 Jan 2023 21:22:44 +0900) 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:252770 Archived-At: > Date: Sun, 01 Jan 2023 21:22:44 +0900 > From: kobarity > > `python-shell-send-region' fails with the following error when the > region starts in the middle of the first line. > > Wrong type argument: wholenump, -1 > > This is caused by the code to insert the coding cookie in > `python-shell-buffer-substring'. I think that the current code > assumes that the region begins at line beginning position. However, > there are some use-cases where the region starts in the middle of the > line as discussed in #60142. So I think the special treatment in case > of point-min should be extended to case of first line. Attached is a > patch to implement this. Thanks, installed on the emacs-29 branch, and closing the bug.