From: Matthias Habl <Matthias.Habl@physik.uni-regensburg.de>
Subject: Markers aren't updated with 'replace-match'
Date: Wed, 25 Sep 2002 20:53:11 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.40.0209252050210.18286-100000@pc8383.physik.uni-regensburg.de> (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
reply other threads:[~2002-09-25 18:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.40.0209252050210.18286-100000@pc8383.physik.uni-regensburg.de \
--to=matthias.habl@physik.uni-regensburg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).