From: Richard M. Stallman Date: Tue, 1 Dec 1998 05:17:11 +0000 (+0000) Subject: (Freplace_match): Set OPOINT clearly for the case X-Git-Tag: emacs-20.4~1159 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9160906f27f60f33916004ea241d84cd3fb178d0;p=emacs.git (Freplace_match): Set OPOINT clearly for the case where point is in the middle of the text to be replaced. --- diff --git a/src/search.c b/src/search.c index 29a6fe4ff4f..e4877b5f498 100644 --- a/src/search.c +++ b/src/search.c @@ -2417,8 +2417,10 @@ since only regular expressions have distinguished subexpressions.") } /* Record point, the move (quietly) to the start of the match. */ - if (PT > search_regs.start[sub]) + if (PT >= search_regs.end[sub]) opoint = PT - ZV; + else if (PT > search_regs.start[sub]) + opoint = search_regs.end[sub] - ZV; else opoint = PT;