>     > When I try it, it replaces both instances of `foo '.
>     > Are you using the development Emacs?
>
>     Yes:  emacs-version "22.0.50.2".  A few days old from HEAD.
>
> Strange.  Can you debug what's happening inside the loop?

It's strange that you can't reproduce it.  Perhaps when you type C-M-% on a
tty, it is interpreted as M-%.  But this bug happens only for regexp replace.

The cause of this bug are lines:

                            (and (or match-again
                                     ;; MATCH-AGAIN non-nil means we
                                     ;; accept an adjacent match.  If
                                     ;; we don't, move one char to the
                                     ;; right.  This takes us a
                                     ;; character too far at the end,
                                     ;; but this is undone after the
                                     ;; while-loop.
                                     (progn
                                       (forward-char 1)

that don't take into account the case when a read-only area is
adjacent to the next match, and skips it by (forward-char 1).

-- 
Juri Linkov
http://www.jurta.org/emacs/



_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to