]> git.eshelyaron.com Git - emacs.git/commitdiff
(perform-replace): Document return value. Use `pop'.
authorColin Walters <walters@gnu.org>
Sun, 26 May 2002 20:42:51 +0000 (20:42 +0000)
committerColin Walters <walters@gnu.org>
Sun, 26 May 2002 20:42:51 +0000 (20:42 +0000)
lisp/replace.el

index 9ce2db1eca484f1388c6e75dd0a089dd333ea83b..82942bc311f829456780274c005d1fb1ada00d95 100644 (file)
@@ -967,7 +967,10 @@ just as `query-replace' does.  Instead, write a simple loop like this:
 
 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 @@ see the documentation of `replace-match' to find out how to simulate
                         (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)))