changeset 45529:45014630aeb2

(perform-replace): Document return value. Use `pop'.
author Colin Walters <walters@gnu.org>
date Sun, 26 May 2002 20:42:51 +0000
parents bc8cc9c5d979
children 19a685f604ee
files lisp/replace.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/replace.el	Sun May 26 20:42:31 2002 +0000
+++ b/lisp/replace.el	Sun May 26 20:42:51 2002 +0000
@@ -967,7 +967,10 @@
 
 which will run faster and probably do exactly what you want.  Please
 see the documentation of `replace-match' to find out how to simulate
-`case-replace'."
+`case-replace'.
+
+This function returns nil if and only if there were no matches to
+make, or the user didn't cancel the call."
   (or map (setq map query-replace-map))
   (and query-flag minibuffer-auto-raise
        (raise-frame (window-frame (minibuffer-window))))
@@ -1123,12 +1126,11 @@
 			 (setq done t))
 			((eq def 'backup)
 			 (if stack
-			     (let ((elt (car stack)))
+			     (let ((elt (pop stack)))
 			       (goto-char (car elt))
 			       (setq replaced (eq t (cdr elt)))
 			       (or replaced
-				   (set-match-data (cdr elt)))
-			       (setq stack (cdr stack)))
+				   (set-match-data (cdr elt))))
 			   (message "No previous match")
 			   (ding 'no-terminate)
 			   (sit-for 1)))