aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorJuri Linkov2004-06-10 04:21:14 +0000
committerJuri Linkov2004-06-10 04:21:14 +0000
commit22a76778dbb444bd15fd9947446b643cf85881b8 (patch)
tree99586cad522ea923cd7059d7c9702d4b04514b5f /lisp/replace.el
parentc9f0110e2127488ab9bef2b6a7b82a51b5824c84 (diff)
downloademacs-22a76778dbb444bd15fd9947446b643cf85881b8.tar.gz
emacs-22a76778dbb444bd15fd9947446b643cf85881b8.zip
(perform-replace): Use `limit' to terminate the while-loop explicitly.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index f7afcd594cf..014762be53e 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1132,7 +1132,7 @@ make, or the user didn't cancel the call."
1132 (unwind-protect 1132 (unwind-protect
1133 ;; Loop finding occurrences that perhaps should be replaced. 1133 ;; Loop finding occurrences that perhaps should be replaced.
1134 (while (and keep-going 1134 (while (and keep-going
1135 (not (eobp)) 1135 (not (or (eobp) (and limit (>= (point) limit))))
1136 ;; Use the next match if it is already known; 1136 ;; Use the next match if it is already known;
1137 ;; otherwise, search for a match after moving forward 1137 ;; otherwise, search for a match after moving forward
1138 ;; one char if progress is required. 1138 ;; one char if progress is required.
@@ -1148,7 +1148,10 @@ make, or the user didn't cancel the call."
1148 ;; character too far at the end, 1148 ;; character too far at the end,
1149 ;; but this is undone after the 1149 ;; but this is undone after the
1150 ;; while-loop. 1150 ;; while-loop.
1151 (progn (forward-char 1) (not (eobp)))) 1151 (progn
1152 (forward-char 1)
1153 (not (or (eobp)
1154 (and limit (>= (point) limit))))))
1152 (funcall search-function search-string limit t) 1155 (funcall search-function search-string limit t)
1153 ;; For speed, use only integers and 1156 ;; For speed, use only integers and
1154 ;; reuse the list used last time. 1157 ;; reuse the list used last time.