bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#42424: 27.0.90; replace-match: point is NOT left at the end of repla


From: Lars Ingebrigtsen
Subject: bug#42424: 27.0.90; replace-match: point is NOT left at the end of replacement
Date: Sun, 18 Oct 2020 10:24:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> Uhm...  is that comment wrong?  Aren't we moving point to the end of the
>> inserted replacement?
>
> Yes, it should say "end", not "start".

Fixed now.

> Personally, I wonder what was expected here.  If the modification
> hooks modify the replaced text behind our back, how can the Lisp
> program which does that expect to have point where it belongs?  Am I
> missing something?

No, the semantics are pretty unclear, and it's not obvious whether we
can guarantee anything here.  But the bug reporter notes:

> Other types of modification (insert or delete) do not have this issue.
> `point' is adjusted before running modification hooks.

So I think the suggestion is to move point to the end of the replacement
before running the modification hooks, i.e., move the point logic to
replace_range.  But I'm not actually sure where the modification hooks
are being run from...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]