]> code.delx.au - gnu-emacs/blobdiff - lisp/replace.el
lisp/gnus/gnus-icalendar.el (gnus-icalendar-identities): Make changing the value...
[gnu-emacs] / lisp / replace.el
index 0490af71358004ab26920e5ebb4cd66a8a9a4e89..2c6b02364b2ec5a7d3a8d5d7827bf578a7731e02 100644 (file)
@@ -524,7 +524,7 @@ and TO-STRING is also null.)"
               (region-end)))))
   (perform-replace from-string to-string nil nil delimited nil nil start end))
 (put 'replace-string 'interactive-only
-     "Use `search-forward' and `replace-match' instead.")
+     "use `search-forward' and `replace-match' instead.")
 
 (defun replace-regexp (regexp to-string &optional delimited start end)
   "Replace things after point matching REGEXP with TO-STRING.
@@ -593,7 +593,7 @@ which will run faster and will not set the mark or print anything."
               (region-end)))))
   (perform-replace regexp to-string nil t delimited nil nil start end))
 (put 'replace-regexp 'interactive-only
-     "Use `re-search-forward' and `replace-match' instead.")
+     "use `re-search-forward' and `replace-match' instead.")
 
 \f
 (defvar regexp-history nil
@@ -1457,7 +1457,9 @@ See also `multi-occur'."
                            ;; so as to override faces copied from the buffer.
                            `(face ,match-face)))
                         curstring)
-                       (setq start (match-end 0))))
+                       ;; Avoid infloop (Bug#7593).
+                       (let ((end (match-end 0)))
+                         (setq start (if (= start end) (1+ start) end)))))
                    ;; Generate the string to insert for this match
                    (let* ((match-prefix
                            ;; Using 7 digits aligns tabs properly.