diff options
| author | Gerd Moellmann | 2000-04-04 21:01:53 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-04-04 21:01:53 +0000 |
| commit | 8f3ff96be4edde86ab7706e580910de695a28775 (patch) | |
| tree | 2fd96b2db168f7e712a065bba194c42257fa56c9 /lisp/replace.el | |
| parent | 60bffb784f89ed2fa0cb1dbfd9c514ba3b034236 (diff) | |
| download | emacs-8f3ff96be4edde86ab7706e580910de695a28775.tar.gz emacs-8f3ff96be4edde86ab7706e580910de695a28775.zip | |
(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.
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 5ff9645aac6..51005ea2fbe 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | ;;; replace.el --- replace commands for Emacs. | 1 | ;;; replace.el --- replace commands for Emacs. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997, 2000 |
| 4 | ;; Free Software Foundation, Inc. | ||
| 4 | 5 | ||
| 5 | ;; This file is part of GNU Emacs. | 6 | ;; This file is part of GNU Emacs. |
| 6 | 7 | ||
| @@ -862,9 +863,17 @@ which will run faster and probably do exactly what you want." | |||
| 862 | (progn (goto-char (nth 1 match-again)) | 863 | (progn (goto-char (nth 1 match-again)) |
| 863 | match-again) | 864 | match-again) |
| 864 | (and (or match-again | 865 | (and (or match-again |
| 865 | (progn | 866 | ;; MATCH-AGAIN nil means in the |
| 866 | (forward-char 1) | 867 | ;; regexp case that there's no |
| 867 | (not (eobp)))) | 868 | ;; match adjacent to the last |
| 869 | ;; one. So, we could move | ||
| 870 | ;; forward, but we don't want to | ||
| 871 | ;; because that moves point 1 | ||
| 872 | ;; position after the last | ||
| 873 | ;; replacement when everything | ||
| 874 | ;; has been done. | ||
| 875 | regexp-flag | ||
| 876 | (progn (forward-char 1) (not (eobp)))) | ||
| 868 | (funcall search-function search-string limit t) | 877 | (funcall search-function search-string limit t) |
| 869 | ;; For speed, use only integers and | 878 | ;; For speed, use only integers and |
| 870 | ;; reuse the list used last time. | 879 | ;; reuse the list used last time. |