[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Does replace-match needs a literal TO-STRING?
From: |
Thorsten Jolitz |
Subject: |
Re: Does replace-match needs a literal TO-STRING? |
Date: |
Tue, 09 Sep 2014 23:26:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Thorsten Jolitz <tjolitz@gmail.com> writes:
> Hi List,
>
> I try to use
>
> #+BEGIN_SRC emacs-lisp
> (when (search-forward FROM-STRING nil t)
> (replace-match TO-STRING nil t))
> #+END_SRC
>
> in a temp-buffer, and it works when TO-STRING is literal like "foo", but
> not when its a function that builds and then returns the string "foo".
>
> Is that a known restriction or am I doing something wrong?
Ok, got it, I have to save-match-data before calling the string building
function (that might regexp search itself), then it works.
Sorry for the noise.
--
cheers,
Thorsten