* Infinite Multiline replacement problem
@ 2004-06-27 7:17 Ding Lei
2004-06-28 20:04 ` Kevin Rodgers
0 siblings, 1 reply; 5+ messages in thread
From: Ding Lei @ 2004-06-27 7:17 UTC (permalink / raw)
Hello list,
I tried to use regexp replace to do a multiline replacement, but
Emacs replaces one occurrence again and again (infinite) ...
Here's the regexp I use,
Replace: \*/[Ctrl-q][Ctrl-j]public void final
With: *@ejb.persistence[Ctrl-q][Ctrl-j]*/[Ctrl-q][Ctrl-j]public void final
As you could see, what I want to do is insert an additional "@ejb.persistence" string
before the line "*/". But emacs always replaces the first occurrence,
and the result is that numerous "*@ejb.persistence" string is inserted
until *deadlock*.
Thank you.
--
Yours,
<<<::::: D i n g L e i ::::::>>
|| ||
|| Ext: 8106 ||
|| Email: <dinglei [A] ipanel [O] cn> ||
|| Dept. Of Technology/Engineering ||
|| Embedded Internet Solutions Inc. ||
|| ||
<(((((( ===================== )))))>>>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Infinite Multiline replacement problem
2004-06-27 7:17 Infinite Multiline replacement problem Ding Lei
@ 2004-06-28 20:04 ` Kevin Rodgers
2004-06-29 10:05 ` Ding Lei
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Rodgers @ 2004-06-28 20:04 UTC (permalink / raw)
Ding Lei wrote:
> I tried to use regexp replace to do a multiline replacement, but
> Emacs replaces one occurrence again and again (infinite) ...
> Here's the regexp I use,
> Replace: \*/[Ctrl-q][Ctrl-j]public void final
> With: *@ejb.persistence[Ctrl-q][Ctrl-j]*/[Ctrl-q][Ctrl-j]public void final
>
> As you could see, what I want to do is insert an additional
> "@ejb.persistence" string before the line "*/". But emacs always
> replaces the first occurrence, and the result is that numerous
> "*@ejb.persistence" string is inserted until *deadlock*.
It works for me in Emacs 21.3. What version are you using?
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Infinite Multiline replacement problem
2004-06-28 20:04 ` Kevin Rodgers
@ 2004-06-29 10:05 ` Ding Lei
2004-06-29 18:39 ` Kevin Rodgers
0 siblings, 1 reply; 5+ messages in thread
From: Ding Lei @ 2004-06-29 10:05 UTC (permalink / raw)
Cc: help-gnu-emacs
Hi Kevin,
I'v tried the stable release and also CVS one.
I wonder how did you test it? the problem might occurs when there
are several occurrences.
Ding Lei
On Mon, Jun 28, 2004 at 02:04:57PM -0600, Kevin Rodgers wrote:
> Ding Lei wrote:
> > I tried to use regexp replace to do a multiline replacement, but
> > Emacs replaces one occurrence again and again (infinite) ...
> > Here's the regexp I use,
> > Replace: \*/[Ctrl-q][Ctrl-j]public void final
> > With: *@ejb.persistence[Ctrl-q][Ctrl-j]*/[Ctrl-q][Ctrl-j]public void final
> >
> > As you could see, what I want to do is insert an additional
> > "@ejb.persistence" string before the line "*/". But emacs always
> > replaces the first occurrence, and the result is that numerous
> > "*@ejb.persistence" string is inserted until *deadlock*.
>
> It works for me in Emacs 21.3. What version are you using?
>
> --
> Kevin Rodgers
>
>
>
>
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
--
Yours,
<<<::::: D i n g L e i ::::::>>
|| ||
|| Ext: 8106 ||
|| Email: <dinglei [A] ipanel [O] cn> ||
|| Dept. Of Technology/Engineering ||
|| Embedded Internet Solutions Inc. ||
|| ||
<(((((( ===================== )))))>>>
Here is the fact of the week, maybe even the fact of the
month. According to probably reliable sources, the Coca-Cola people
are experiencing severe marketing anxiety in China.
The words "Coca-Cola" translate into Chinese as either
(depending on the inflection) "wax-fattened mare" or "bite the wax
tadpole".
Bite the wax tadpole.
There is a sort of rough justice, is there not?
The trouble with this fact, as lovely as it is, is that it's
hard to get a whole column out of it. I'd like to teach the world to
bite a wax tadpole. Coke -- it's the real wax-fattened mare. Not bad,
but broad satiric vistas do not open up.
-- John Carrol, San Francisco Chronicle
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Infinite Multiline replacement problem
2004-06-29 10:05 ` Ding Lei
@ 2004-06-29 18:39 ` Kevin Rodgers
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2004-06-29 18:39 UTC (permalink / raw)
[Please don't top-post.]
Ding Lei wrote:
> I'v tried the stable release and also CVS one.
> I wonder how did you test it? the problem might occurs when there
> are several occurrences.
I put this text in a Fundamental mode buffer:
--------
/* foo */
public void final ...
/* bar */
public void final ...
/* baz */
public void final ...
--------
And used C-M-% (M-x query-replace-regexp).
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <mailman.2315.1088539167.1953.help-gnu-emacs@gnu.org>]
* Re: Infinite Multiline replacement problem
[not found] <mailman.2315.1088539167.1953.help-gnu-emacs@gnu.org>
@ 2004-06-29 20:15 ` Kin Cho
0 siblings, 0 replies; 5+ messages in thread
From: Kin Cho @ 2004-06-29 20:15 UTC (permalink / raw)
Trying using a keyboard macro instead.
Do M-: (info " (elisp) Keyboard Macros") to see.
-kin
Ding Lei <dinglei@ipanel.cn> writes:
> Hello list,
> I tried to use regexp replace to do a multiline replacement, but
> Emacs replaces one occurrence again and again (infinite) ...
> Here's the regexp I use,
> Replace: \*/[Ctrl-q][Ctrl-j]public void final
> With: *@ejb.persistence[Ctrl-q][Ctrl-j]*/[Ctrl-q][Ctrl-j]public void final
>
> As you could see, what I want to do is insert an additional "@ejb.persistence" string
> before the line "*/". But emacs always replaces the first occurrence,
> and the result is that numerous "*@ejb.persistence" string is inserted
> until *deadlock*.
>
> Thank you.
>
>
>
>
> --
> Yours,
>
> <<<::::: D i n g L e i ::::::>>
> || ||
> || Ext: 8106 ||
> || Email: <dinglei [A] ipanel [O] cn> ||
> || Dept. Of Technology/Engineering ||
> || Embedded Internet Solutions Inc. ||
> || ||
> <(((((( ===================== )))))>>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-06-29 20:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-27 7:17 Infinite Multiline replacement problem Ding Lei
2004-06-28 20:04 ` Kevin Rodgers
2004-06-29 10:05 ` Ding Lei
2004-06-29 18:39 ` Kevin Rodgers
[not found] <mailman.2315.1088539167.1953.help-gnu-emacs@gnu.org>
2004-06-29 20:15 ` Kin Cho
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).