From: Richard M. Stallman Date: Sun, 29 Sep 2002 17:51:45 +0000 (+0000) Subject: (Freplace_match): Adjust match data for the substitution X-Git-Tag: ttn-vms-21-2-B4~12999 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=98e942e0293fef05a410b07aed1594947b41fcbd;p=emacs.git (Freplace_match): Adjust match data for the substitution just made in the buffer. --- diff --git a/src/search.c b/src/search.c index f795eb40abe..6f6aa90b919 100644 --- a/src/search.c +++ b/src/search.c @@ -2567,6 +2567,20 @@ since only regular expressions have distinguished subexpressions. */) 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);