Subject: bug#61463: closed (Re: bug#61463: 29.0.60; python-shell-send-region moves point)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 18 Feb 2023 16:46:02 +0000

Your bug report

#61463: 29.0.60; python-shell-send-region moves point

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
61463: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61463
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#61463: 29.0.60; python-shell-send-region moves point
From: Eli Zaretskii <[email-masked]>
To: kobarity <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 18 Feb 2023 18:45:17 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Cc: [email-masked]
> Date: Tue, 14 Feb 2023 00:43:39 +0900
> From: kobarity <[email-masked]>
> 
> 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.

Subject: 29.0.60; python-shell-send-region moves point
From: Augusto Stoffel <[email-masked]>
To: [email-masked]
Date: Sun, 12 Feb 2023 22:55:07 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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.