diff options
author | Juri Linkov <[email protected]> | 2004-06-10 04:21:14 +0000 |
---|---|---|
committer | Juri Linkov <[email protected]> | 2004-06-10 04:21:14 +0000 |
commit | 22a76778dbb444bd15fd9947446b643cf85881b8 (patch) | |
tree | 99586cad522ea923cd7059d7c9702d4b04514b5f /lisp | |
parent | c9f0110e2127488ab9bef2b6a7b82a51b5824c84 (diff) |
(perform-replace): Use `limit' to terminate the while-loop explicitly.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/replace.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index f7afcd594c..014762be53 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1132,7 +1132,7 @@ make, or the user didn't cancel the call." (unwind-protect ;; Loop finding occurrences that perhaps should be replaced. (while (and keep-going - (not (eobp)) + (not (or (eobp) (and limit (>= (point) limit)))) ;; Use the next match if it is already known; ;; otherwise, search for a match after moving forward ;; one char if progress is required. @@ -1148,7 +1148,10 @@ make, or the user didn't cancel the call." ;; character too far at the end, ;; but this is undone after the ;; while-loop. - (progn (forward-char 1) (not (eobp)))) + (progn + (forward-char 1) + (not (or (eobp) + (and limit (>= (point) limit)))))) (funcall search-function search-string limit t) ;; For speed, use only integers and ;; reuse the list used last time. |