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

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

Re: Advanced query-replace-regexp in code


From: Nordlöw
Subject: Re: Advanced query-replace-regexp in code
Date: Fri, 29 May 2009 23:34:45 -0700 (PDT)
User-agent: G2/1.0

On May 29, 4:14 am, Barry Margolin <address@hidden> wrote:
> In article <address@hidden>,
> address@hidden (Johan Bockgard) wrote:
>
> > Barry Margolin <address@hidden> 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.
>
> Regardless of whether they should or shouldn't use it, it still seems
> strange that the function interprets the second argument differently
> depending on whether it's use interactively or programmatically.  If it
> shouldn't be used programmatically, why is it important that this mode
> *not* recognize \,<expr>?
>
> --
> Barry Margolin, address@hidden
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***
> *** PLEASE don't copy me on replies, I'll read them in the group ***

I agree, this makes no sense as this is powerful feature, eventhough
it runs slowly.

/Nordlöw


reply via email to

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