Mercurial > emacs
changeset 47686:fc66469fe069
(Freplace_match): Adjust match data for the substitution
just made in the buffer.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 29 Sep 2002 17:51:45 +0000 |
parents | 3fab8e0e1480 |
children | 054a4d4af618 |
files | src/search.c |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/search.c Sun Sep 29 17:46:12 2002 +0000 +++ b/src/search.c Sun Sep 29 17:51:45 2002 +0000 @@ -2567,6 +2567,20 @@ Fupcase_initials_region (make_number (search_regs.start[sub]), make_number (newpoint)); + /* Adjust search data for this change. */ + { + int change = newpoint - search_regs.end[sub]; + int i; + + for (i = 0; i < search_regs.num_regs; i++) + { + if (search_regs.start[i] > newpoint) + search_regs.start[i] += change; + if (search_regs.end[i] > newpoint) + search_regs.end[i] += change; + } + } + /* Put point back where it was in the text. */ if (opoint <= 0) TEMP_SET_PT (opoint + ZV);