bug-gnu-emacs
[Top][All Lists]
Advanced

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

Markers aren't updated with 'replace-match'


From: Matthias Habl
Subject: Markers aren't updated with 'replace-match'
Date: Wed, 25 Sep 2002 20:53:11 +0200 (CEST)

In GNU Emacs 21.1.3 (i586-pc-linux-gnu, X toolkit)
 of 2002-01-13 on mhilin

When replacing two matched substrings in series the markers of the
match data (available with (match-data)) aren't updated. In the
following example I want to replace "A" and "B" with "11" and "22"
respectively.

(defun test-replace-match ()
  (interactive)
  (when (re-search-forward "\\(A\\) and \\(B\\)")
    (replace-match "11" nil nil nil 1)
    (replace-match "22" nil nil nil 2)))

But when doing M-x test-replace-match at the beginning of the next
line

        Test string: A and B

the result is

        Test string: 11 and22B

instead of 'Test string: 11 and 22'.

Why does the match data consist of markers although these aren't
updated when using the function 'replace-match', which is used
most commonly after doing a RE search?

Matthias


Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: C
  locale-coding-system: nil
  default-enable-multibyte-characters: t






reply via email to

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