* Markers aren't updated with 'replace-match'
@ 2002-09-25 18:53 Matthias Habl
0 siblings, 0 replies; only message in thread
From: Matthias Habl @ 2002-09-25 18:53 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-09-25 18:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-25 18:53 Markers aren't updated with 'replace-match' Matthias Habl
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).