# HG changeset patch # User Gerd Moellmann # Date 954882113 0 # Node ID 3e4e6d45a77488d5d8178851d041607b6e30fd0e # Parent 030a9790d290167b2fd63b029e92bfbe8ab485e5 (perform-replace): Don't move forward one char when MATCH-AGAIN is nil, and REGEXP-FLAG is t. We don't want to do that because it leaves point 1 position after the last replacement, after everything has been replaced. diff -r 030a9790d290 -r 3e4e6d45a774 lisp/replace.el --- a/lisp/replace.el Tue Apr 04 21:00:36 2000 +0000 +++ b/lisp/replace.el Tue Apr 04 21:01:53 2000 +0000 @@ -1,6 +1,7 @@ ;;; replace.el --- replace commands for Emacs. -;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997 Free Software Foundation, Inc. +;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997, 2000 +;; Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -862,9 +863,17 @@ (progn (goto-char (nth 1 match-again)) match-again) (and (or match-again - (progn - (forward-char 1) - (not (eobp)))) + ;; MATCH-AGAIN nil means in the + ;; regexp case that there's no + ;; match adjacent to the last + ;; one. So, we could move + ;; forward, but we don't want to + ;; because that moves point 1 + ;; position after the last + ;; replacement when everything + ;; has been done. + regexp-flag + (progn (forward-char 1) (not (eobp)))) (funcall search-function search-string limit t) ;; For speed, use only integers and ;; reuse the list used last time.