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

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

Re: replace deprecated function ?


From: Joost Kremers
Subject: Re: replace deprecated function ?
Date: Wed, 14 Feb 2018 00:19:30 +0100
User-agent: mu4e 1.0-alpha3; emacs 25.3.50.1


On Tue, Feb 13 2018, B. T. Raven wrote:
Thanks Emanuel but I need it to be more interactive. I want to look at each number that the query finds and press either space bar or n. The following produces argument "Args out of range" for no reason that I can ascertain. query-replace-regex has 5 args rexexp string, string, nil, int and int. Whence
the error?

I suspect it's because you cannot use `match-string' to refer to the match data of the regexp search still being executed.

The doc string of `query-replace-regexp-eval' says that in non-interactive use, you should use a loop of `search-regexp-forward' plus `replace-match'. You may be able to wrap the `replace-match' call in y-or-n-p.

HTH

--
Joost Kremers
Life has its moments



reply via email to

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