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: Stefan Monnier
Subject: bug#42424: 27.0.90; replace-match: point is NOT left at the end of replacement
Date: Tue, 09 Apr 2024 11:14:35 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

> This issue happens when modification hooks modify the text before the
> end of replacement text.

Modification hooks which modify the buffer text are just getting what
they deserve.

> But the end of replacement might be changed inside of `replace_range'.
> So the final movement of point may end up to a wrong place.

This is just one of the many problems.

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

Yes, occasionally doing bad things won't bite you in the rear.
That doesn't justify doing those things.

If you want to modify the buffer in response to other buffer
modifications, then record this fact in the modification hook and then
act on it later, e.g. in a timer.
Anything else *will* cause problems sooner or later.


        Stefan






reply via email to

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