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


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77607 <at> debbugs.gnu.org, "Paul D. Nelson" <ultrono <at> gmail.com>
Subject: bug#77607: 31.0.50; replace-region-contents moves point
Date: Mon, 07 Apr 2025 11:11:44 -0400
>> 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?

Indeed that's a bug.


        Stefan





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.