[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: query-replace-regexp and read-only text properties

From: Juri Linkov
Subject: Re: query-replace-regexp and read-only text properties
Date: Tue, 27 Dec 2005 03:18:34 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>     > When I try it, it replaces both instances of `foo '.
>     > Are you using the development Emacs?
>     Yes:  emacs-version "".  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.
                                       (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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]