[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Advanced query-replace-regexp in code
From: |
Johan Bockgård |
Subject: |
Re: Advanced query-replace-regexp in code |
Date: |
Thu, 28 May 2009 21:36:23 +0200 |
User-agent: |
Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.90 (gnu/linux) |
Barry Margolin <barmar@alum.mit.edu> writes:
> In that case, why allow programs to call replace-regexp in the first
> place? If they can call it, why shouldn't they be able to use all the
> features?
They shouldn't call it:
This function is usually the wrong thing to use in a Lisp program.
What you probably want is a loop like this:
(while (re-search-forward REGEXP nil t)
(replace-match TO-STRING nil nil))
which will run faster and will not set the mark or print anything.
- Advanced query-replace-regexp in code, Nordlöw, 2009/05/27
- Re: Advanced query-replace-regexp in code, Pascal J. Bourguignon, 2009/05/27
- Re: Advanced query-replace-regexp in code, Barry Margolin, 2009/05/27
- Re: Advanced query-replace-regexp in code, Teemu Likonen, 2009/05/28
- Re: Advanced query-replace-regexp in code, Barry Margolin, 2009/05/28
- Re: Advanced query-replace-regexp in code,
Johan Bockgård <=
- Message not available
- Re: Advanced query-replace-regexp in code, Barry Margolin, 2009/05/28
- Re: Advanced query-replace-regexp in code, Nordlöw, 2009/05/30
- Re: Advanced query-replace-regexp in code, Johan Bockgård, 2009/05/30
- Message not available
- Re: Advanced query-replace-regexp in code, Barry Margolin, 2009/05/30
Re: Advanced query-replace-regexp in code, harven, 2009/05/28