GNU bug report logs -
#42424
27.0.90; replace-match: point is NOT left at the end of replacement
Previous Next
Reported by: Ren Victor <victorhge <at> gmail.com>
Date: Sun, 19 Jul 2020 05:53:02 UTC
Severity: normal
Tags: patch
Found in version 27.0.90
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Lars Ingebrigtsen <larsi <at> 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
This bug report was last modified 1 year and 120 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.