X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Freplace.el;h=71b80549e3965382e4a3e6d81dae7aefad13f4b2;hb=ea1ea793fe6e244ef5555ed983423a204101af13;hp=3b6165e5901c5f48a03df3e7d9fca3c58c2263c1;hpb=f3ec20f455f3f1212d2c5ee4cadc984330da9c38;p=chise%2Fxemacs-chise.git diff --git a/lisp/replace.el b/lisp/replace.el index 3b6165e..71b8054 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -679,6 +679,7 @@ When searching for a match, this function use `replace-search-function' and `rep ;; Loop finding occurrences that perhaps should be replaced. (while (and keep-going (not (eobp)) + (or (null limit) (< (point) limit)) (let ((case-fold-search qr-case-fold-search)) (funcall search-function search-string limit)) ;; If the search string matches immediately after @@ -688,7 +689,8 @@ When searching for a match, this function use `replace-search-function' and `rep (and regexp-flag (eq lastrepl (match-beginning 0)) (not match-again))) - (if (eobp) + (if (or (eobp) + (and limit (>= (point) limit))) nil ;; Don't replace the null string ;; right after end of previous replacement.