GNU bug report logs - #61463
29.0.60; python-shell-send-region moves point

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Sun, 12 Feb 2023 21:56:01 UTC

Severity: normal

Found in version 29.0.60

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61463 in the body.
You can then email your comments to 61463 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to kobarity <at> gmail.com, bug-gnu-emacs <at> gnu.org:
bug#61463; Package emacs. (Sun, 12 Feb 2023 21:56:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Augusto Stoffel <arstoffel <at> gmail.com>:
New bug report received and forwarded. Copy sent to kobarity <at> gmail.com, bug-gnu-emacs <at> gnu.org. (Sun, 12 Feb 2023 21:56:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.60; python-shell-send-region moves point
Date: Sun, 12 Feb 2023 22:55:07 +0100
On Emacs -Q:

1) M-x run-python
2) In the scratch buffer, type something, say 1 + 2 and mark it, leaving
   point at the end.
3) M-x python-shell-send-string

Now the point is at the beginning of the region.  It was supposed not to
move.

I suspect this might be due to a missing `save-excursion' in the
definition of the local variable `single-p' in python.el.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61463; Package emacs. (Mon, 13 Feb 2023 15:45:02 GMT) Full text and rfc822 format available.

Message #8 received at 61463 <at> debbugs.gnu.org (full text, mbox):

From: kobarity <kobarity <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 61463 <at> debbugs.gnu.org
Subject: Re: bug#61463: 29.0.60; python-shell-send-region moves point
Date: Tue, 14 Feb 2023 00:43:39 +0900
[Message part 1 (text/plain, inline)]
Augusto Stoffel wrote:
> On Emacs -Q:
> 
> 1) M-x run-python
> 2) In the scratch buffer, type something, say 1 + 2 and mark it, leaving
>    point at the end.
> 3) M-x python-shell-send-string

Probably a typo of python-shell-send-region.

> Now the point is at the beginning of the region.  It was supposed not to
> move.
> 
> I suspect this might be due to a missing `save-excursion' in the
> definition of the local variable `single-p' in python.el.

Thank you for pointing that out.  You are right, `single-p' needs
`save-excursion'.  The same bug exists in `starts-at-first-line-p'.
I'm sorry for those bugs.

Atatched is a fix for this problem with improved ERTs to detect this
issue.
[0001-Fix-point-moving-when-calling-python-shell-send-regi.patch (application/octet-stream, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 18 Feb 2023 16:46:02 GMT) Full text and rfc822 format available.

Notification sent to Augusto Stoffel <arstoffel <at> gmail.com>:
bug acknowledged by developer. (Sat, 18 Feb 2023 16:46:02 GMT) Full text and rfc822 format available.

Message #13 received at 61463-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kobarity <kobarity <at> gmail.com>
Cc: 61463-done <at> debbugs.gnu.org, arstoffel <at> gmail.com
Subject: Re: bug#61463: 29.0.60; python-shell-send-region moves point
Date: Sat, 18 Feb 2023 18:45:17 +0200
> Cc: 61463 <at> debbugs.gnu.org
> Date: Tue, 14 Feb 2023 00:43:39 +0900
> From: kobarity <kobarity <at> gmail.com>
> 
> Augusto Stoffel wrote:
> > On Emacs -Q:
> > 
> > 1) M-x run-python
> > 2) In the scratch buffer, type something, say 1 + 2 and mark it, leaving
> >    point at the end.
> > 3) M-x python-shell-send-string
> 
> Probably a typo of python-shell-send-region.
> 
> > Now the point is at the beginning of the region.  It was supposed not to
> > move.
> > 
> > I suspect this might be due to a missing `save-excursion' in the
> > definition of the local variable `single-p' in python.el.
> 
> Thank you for pointing that out.  You are right, `single-p' needs
> `save-excursion'.  The same bug exists in `starts-at-first-line-p'.
> I'm sorry for those bugs.
> 
> Atatched is a fix for this problem with improved ERTs to detect this
> issue.

Thanks, installed on the emacs-29 branch, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 19 Mar 2023 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 94 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.