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: Sat, 31 Jul 2021 16:03:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> 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.

No, that was wrong -- the suggestion was to not move point to the end of
the replacement text (numerically speaking).  But we can't do that --
the `replace-match' interface guarantees that it will do that, and
changing this will break stuff.

The modification hooks may do all kinda of oddball stuff that changes
the buffer before moving to that point, so to make that work more
reliably, we'd have to make a marker, I think?  But `replace-match' is
used so heavily that I'm not sure the performance impact won't be
noticeable.

One possible idea is to postpone the modification hooks until the end of
replace_match (instead of doing it in replace_range -- that should have
no performance impact, and not change behaviour in most cases.  But I'm
having problems making that work.

The hook is called from update_compositions, isn't it?  Are there any
caveats to using that?

-- 
(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]