GNU bug report logs - #77607
31.0.50; replace-region-contents moves point

Previous Next

Package: emacs;

Reported by: "Paul D. Nelson" <ultrono <at> gmail.com>

Date: Mon, 7 Apr 2025 12:10:02 UTC

Severity: normal

Found in version 31.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Paul D. Nelson" <ultrono <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 77607 <at> debbugs.gnu.org
Subject: Re: bug#77607: 31.0.50; replace-region-contents moves point
Date: Mon, 07 Apr 2025 16:45:56 +0300
> From: "Paul D. Nelson" <ultrono <at> gmail.com>
> Date: Mon, 07 Apr 2025 14:09:12 +0200
> 
> The info docs for replace-region-contents say that it attempts to
> preserve point.  With the latest update, it fails to preserve point in
> cases where it did before.  I fixed my use case with save-excursion, and
> the docs are vague enough that this issue might not qualify as a bug,
> but I figured I'd report it just in case it was unintentional, or in
> case others come across it.
> 
> For example:
> 
> (with-temp-buffer
>   (insert "abc")
>   (replace-region-contents (- (point) 3) (- (point) 2) (lambda () "A"))
>   (char-to-string (char-before)))
> 
> now returns "A", but I believe that it previously returned "c".

Stefan, any comments?




This bug report was last modified 43 days ago.

Previous Next


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