[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A variant of match-end, but after replacement?
From: |
Marcin Borkowski |
Subject: |
Re: A variant of match-end, but after replacement? |
Date: |
Sun, 19 Jul 2015 21:58:32 +0200 |
On 2015-07-19, at 15:41, Pascal J. Bourguignon <pjb@informatimago.com> wrote:
> Marcin Borkowski <mbork@mbork.pl> writes:
>
>>> (let ((old-end (prog1 (match-end 1)
>>> (replace-match "newtext" t t string 1))))
>>> (do-something old-end))
>>
>> Still not there - I can't assume that "newtext" will have the same
>> length as the thing it replaced...
>
> Sorry, I misread what you wanted.
>
> (let ((new-end (+ (prog1 (match-beginning 1)
> (replace-match new-text t t string 1)))
> (length new-text)))
> (do-somthing-from new-end))
Thanks! That's easy, and indeed it will work, since the length of the
replacement is fixed in my use-case.
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
- Re: A variant of match-end, but after replacement?, (continued)
- Re: A variant of match-end, but after replacement?, Dmitry Gutov, 2015/07/19
- Re: A variant of match-end, but after replacement?, Pascal J. Bourguignon, 2015/07/19
- Re: A variant of match-end, but after replacement?, Marcin Borkowski, 2015/07/19
- Message not available
- Re: A variant of match-end, but after replacement?, Pascal J. Bourguignon, 2015/07/19
- Re: A variant of match-end, but after replacement?, Marcin Borkowski, 2015/07/19
- Re: A variant of match-end, but after replacement?, Dmitry Gutov, 2015/07/19
- Re: A variant of match-end, but after replacement?, Marcin Borkowski, 2015/07/19
- Message not available
- Re: A variant of match-end, but after replacement?, Pascal J. Bourguignon, 2015/07/19
- Re: A variant of match-end, but after replacement?,
Marcin Borkowski <=
- Message not available
- Re: A variant of match-end, but after replacement?, Barry Margolin, 2015/07/19
- Re: A variant of match-end, but after replacement?, Pascal J. Bourguignon, 2015/07/19
- Re: A variant of match-end, but after replacement?, Marcin Borkowski, 2015/07/19
- Message not available
- Re: A variant of match-end, but after replacement?, Pascal J. Bourguignon, 2015/07/19