* query-replace
@ 2006-05-04 23:33 Pedro Sa da Costa
2006-05-05 0:40 ` query-replace Nikos Apostolakis
0 siblings, 1 reply; 14+ messages in thread
From: Pedro Sa da Costa @ 2006-05-04 23:33 UTC (permalink / raw)
Hi,
1 -
I have this text: "and the android goes away."
I want to replace the word "and" to "or", but i don't want to replace
the word " [and]roid". How should i do this in emacs? The M-% doesn't
work in this case.
2 - I know that this isn't latex mailing list, but i can't find any.
Anyone knows a mailing list to latex?
Thanks,
Pedro
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
[not found] <mailman.1453.1146785668.9609.help-gnu-emacs@gnu.org>
@ 2006-05-05 0:15 ` liyer.vijay
2006-05-05 0:19 ` query-replace Johan Bockgård
2006-05-05 6:49 ` query-replace Malte Spiess
2 siblings, 0 replies; 14+ messages in thread
From: liyer.vijay @ 2006-05-05 0:15 UTC (permalink / raw)
Pedro Sa da Costa wrote:
> 1 -
> I have this text: "and the android goes away."
> I want to replace the word "and" to "or", but i don't want to replace
> the word " [and]roid". How should i do this in emacs? The M-% doesn't
> work in this case.
See C-M-% query-replace-regexp
In your specific case, you need:
M-x query-replace-regexp \band\b RET or RET
> 2 - I know that this isn't latex mailing list, but i can't find any.
> Anyone knows a mailing list to latex?
comp.text.tex ?
Cheers
Vijay
> Can we quote you on that?
A long time ago, someone in the Lisp industry told me it was poor form
quote people; it suggests that they lack value.
-- Kent M Pitman <pitman@world.std.com> in comp.lang.lisp
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
[not found] <mailman.1453.1146785668.9609.help-gnu-emacs@gnu.org>
2006-05-05 0:15 ` query-replace liyer.vijay
@ 2006-05-05 0:19 ` Johan Bockgård
2006-05-05 6:49 ` query-replace Malte Spiess
2 siblings, 0 replies; 14+ messages in thread
From: Johan Bockgård @ 2006-05-05 0:19 UTC (permalink / raw)
Pedro Sa da Costa <op132650c@mail.telepac.pt> writes:
> I have this text: "and the android goes away."
> I want to replace the word "and" to "or", but i don't want to replace
> the word " [and]roid". How should i do this in emacs? The M-%
> doesn't work in this case.
C-u M-%
--
Johan Bockgård
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
2006-05-04 23:33 query-replace Pedro Sa da Costa
@ 2006-05-05 0:40 ` Nikos Apostolakis
0 siblings, 0 replies; 14+ messages in thread
From: Nikos Apostolakis @ 2006-05-05 0:40 UTC (permalink / raw)
Pedro Sa da Costa <op132650c@mail.telepac.pt> writes:
> 1 -
> I have this text: "and the android goes away."
> I want to replace the word "and" to "or", but i don't want to
> replace the word " [and]roid". How should i do this in emacs? The
> M-% doesn't work in this case.
>
Well you could answer "n" when the query is at the word "android", but
I guess you don't want to do that ;)
You can try "query-replace-regexp" which by default is bound to
"C-M-%", for your example:
"C-M-% \<and\> RET to RET"
> Thanks,
> Pedro
--
Nikos
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
[not found] <mailman.1453.1146785668.9609.help-gnu-emacs@gnu.org>
2006-05-05 0:15 ` query-replace liyer.vijay
2006-05-05 0:19 ` query-replace Johan Bockgård
@ 2006-05-05 6:49 ` Malte Spiess
2006-05-05 14:55 ` query-replace B. T. Raven
2 siblings, 1 reply; 14+ messages in thread
From: Malte Spiess @ 2006-05-05 6:49 UTC (permalink / raw)
Pedro Sa da Costa <op132650c@mail.telepac.pt> writes:
> Hi,
>
> 1 -
> I have this text: "and the android goes away."
> I want to replace the word "and" to "or", but i don't want to replace
> the word " [and]roid". How should i do this in emacs? The M-%
> doesn't work in this case.
The simplest way should be to replace "and " by "or ".
> Thanks,
> Pedro
Greetings
Malte
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
2006-05-05 6:49 ` query-replace Malte Spiess
@ 2006-05-05 14:55 ` B. T. Raven
2006-05-05 17:11 ` query-replace Kevin Rodgers
[not found] ` <mailman.1484.1146849219.9609.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 14+ messages in thread
From: B. T. Raven @ 2006-05-05 14:55 UTC (permalink / raw)
"Malte Spiess" <cuts@arcor.de> wrote in message
news:87bqudhsox.fsf@ulm.malte.spiess...
> Pedro Sa da Costa <op132650c@mail.telepac.pt> writes:
>
> > Hi,
> >
> > 1 -
> > I have this text: "and the android goes away."
> > I want to replace the word "and" to "or", but i don't want to replace
> > the word " [and]roid". How should i do this in emacs? The M-%
> > doesn't work in this case.
>
> The simplest way should be to replace "and " by "or ".
>
> > Thanks,
> > Pedro
>
> Greetings
> Malte
Even simpler is M-% _and_ RET _or_ (where the underscores represent
explicit spaces typed into the pattern strings.
Ed
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
2006-05-05 14:55 ` query-replace B. T. Raven
@ 2006-05-05 17:11 ` Kevin Rodgers
2006-05-06 0:25 ` query-replace Pedro Sa da Costa
[not found] ` <mailman.1499.1146875164.9609.help-gnu-emacs@gnu.org>
[not found] ` <mailman.1484.1146849219.9609.help-gnu-emacs@gnu.org>
1 sibling, 2 replies; 14+ messages in thread
From: Kevin Rodgers @ 2006-05-05 17:11 UTC (permalink / raw)
B. T. Raven wrote:
> Even simpler is M-% _and_ RET _or_ (where the underscores represent
> explicit spaces typed into the pattern strings.
Which doesn't work if "and" occurs at the beginning or end of a line.
--
Kevin
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
2006-05-05 17:11 ` query-replace Kevin Rodgers
@ 2006-05-06 0:25 ` Pedro Sa da Costa
2006-05-06 2:50 ` query-replace Nikos Apostolakis
[not found] ` <mailman.1499.1146875164.9609.help-gnu-emacs@gnu.org>
1 sibling, 1 reply; 14+ messages in thread
From: Pedro Sa da Costa @ 2006-05-06 0:25 UTC (permalink / raw)
And in this example, how i replace case sensitive words? I want to
replace all "and" occurrences with "or", and not the "And" words.
Any help?
Thanks
Kevin Rodgers wrote:
> B. T. Raven wrote:
>> Even simpler is M-% _and_ RET _or_ (where the underscores represent
>> explicit spaces typed into the pattern strings.
>
> Which doesn't work if "and" occurs at the beginning or end of a line.
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
[not found] ` <mailman.1484.1146849219.9609.help-gnu-emacs@gnu.org>
@ 2006-05-06 0:40 ` Miles Bader
2006-05-08 17:28 ` query-replace Kevin Rodgers
[not found] ` <mailman.1583.1147109410.9609.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 14+ messages in thread
From: Miles Bader @ 2006-05-06 0:40 UTC (permalink / raw)
Kevin Rodgers <ihs_4664@yahoo.com> writes:
>> Even simpler is M-% _and_ RET _or_ (where the underscores represent
>> explicit spaces typed into the pattern strings.
>
> Which doesn't work if "and" occurs at the beginning or end of a line.
Actually, the simplest way is to just use a `C-u' prefix to the replace
or query-replace command -- it causes the replacements only be done on
"word delimited" matches.
So: C-u M-% and RET or RET
(no significant spaces)
-Miles
--
"Suppose we've chosen the wrong god. Every time we go to church we're
just making him madder and madder." -- Homer Simpson
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
[not found] ` <mailman.1499.1146875164.9609.help-gnu-emacs@gnu.org>
@ 2006-05-06 2:03 ` Barry Margolin
2006-05-31 2:26 ` query-replace David Combs
0 siblings, 1 reply; 14+ messages in thread
From: Barry Margolin @ 2006-05-06 2:03 UTC (permalink / raw)
In article <mailman.1499.1146875164.9609.help-gnu-emacs@gnu.org>,
Pedro Sa da Costa <op132650c@mail.telepac.pt> wrote:
> And in this example, how i replace case sensitive words? I want to
> replace all "and" occurrences with "or", and not the "And" words.
M-x set-variable case-fold-search nil
--
Barry Margolin, barmar@alum.mit.edu
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 ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
2006-05-06 0:25 ` query-replace Pedro Sa da Costa
@ 2006-05-06 2:50 ` Nikos Apostolakis
0 siblings, 0 replies; 14+ messages in thread
From: Nikos Apostolakis @ 2006-05-06 2:50 UTC (permalink / raw)
Pedro Sa da Costa <op132650c@mail.telepac.pt> writes:
> And in this example, how i replace case sensitive words? I want to
> replace all "and" occurrences with "or", and not the "And" words.
>
M-x set-variable RET case-fold-search RET nil RET
--
Nikos
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
2006-05-06 0:40 ` query-replace Miles Bader
@ 2006-05-08 17:28 ` Kevin Rodgers
[not found] ` <mailman.1583.1147109410.9609.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 14+ messages in thread
From: Kevin Rodgers @ 2006-05-08 17:28 UTC (permalink / raw)
Miles Bader wrote:
> Kevin Rodgers <ihs_4664@yahoo.com> writes:
>>> Even simpler is M-% _and_ RET _or_ (where the underscores represent
>>> explicit spaces typed into the pattern strings.
>> Which doesn't work if "and" occurs at the beginning or end of a line.
>
> Actually, the simplest way is to just use a `C-u' prefix to the replace
> or query-replace command -- it causes the replacements only be done on
> "word delimited" matches.
>
> So: C-u M-% and RET or RET
>
> (no significant spaces)
Wow, that is very cool. I can't believe I wasn't aware of that feature.
However, it would be even nicer if the prefix arg changed the prompt
from "Query replace: " to something like "Query replace word(s): ".
Thanks,
--
Kevin
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
[not found] ` <mailman.1583.1147109410.9609.help-gnu-emacs@gnu.org>
@ 2006-05-31 2:22 ` David Combs
0 siblings, 0 replies; 14+ messages in thread
From: David Combs @ 2006-05-31 2:22 UTC (permalink / raw)
In article <mailman.1583.1147109410.9609.help-gnu-emacs@gnu.org>,
Kevin Rodgers <ihs_4664@yahoo.com> wrote:
>Miles Bader wrote:
>> Kevin Rodgers <ihs_4664@yahoo.com> writes:
>>>> Even simpler is M-% _and_ RET _or_ (where the underscores represent
>>>> explicit spaces typed into the pattern strings.
>>> Which doesn't work if "and" occurs at the beginning or end of a line.
>>
>> Actually, the simplest way is to just use a `C-u' prefix to the replace
>> or query-replace command -- it causes the replacements only be done on
>> "word delimited" matches.
>>
>> So: C-u M-% and RET or RET
>>
>> (no significant spaces)
>
>Wow, that is very cool. I can't believe I wasn't aware of that feature.
>However, it would be even nicer if the prefix arg changed the prompt
>from "Query replace: " to something like "Query replace word(s): ".
A *very* good idea!
Kevin (since they know you) could you please send
the suggestion to the devel-group?
Thanks!
David
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: query-replace
2006-05-06 2:03 ` query-replace Barry Margolin
@ 2006-05-31 2:26 ` David Combs
0 siblings, 0 replies; 14+ messages in thread
From: David Combs @ 2006-05-31 2:26 UTC (permalink / raw)
In article <barmar-4C88BD.22033805052006@comcast.dca.giganews.com>,
Barry Margolin <barmar@alum.mit.edu> wrote:
>In article <mailman.1499.1146875164.9609.help-gnu-emacs@gnu.org>,
> Pedro Sa da Costa <op132650c@mail.telepac.pt> wrote:
>
>> And in this example, how i replace case sensitive words? I want to
>> replace all "and" occurrences with "or", and not the "And" words.
>
>M-x set-variable case-fold-search nil
>
>--
>Barry Margolin, barmar@alum.mit.edu
>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 ***
As with Kevin's suggestion, it would be nice if, when that
variable is off, the search prompt would say so.
If you agree, perhaps you could send the suggestion
to the devel-people.
(Again, "you", since they know and respect you (and
Kevin).)
Thanks!
David
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2006-05-31 2:26 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-04 23:33 query-replace Pedro Sa da Costa
2006-05-05 0:40 ` query-replace Nikos Apostolakis
[not found] <mailman.1453.1146785668.9609.help-gnu-emacs@gnu.org>
2006-05-05 0:15 ` query-replace liyer.vijay
2006-05-05 0:19 ` query-replace Johan Bockgård
2006-05-05 6:49 ` query-replace Malte Spiess
2006-05-05 14:55 ` query-replace B. T. Raven
2006-05-05 17:11 ` query-replace Kevin Rodgers
2006-05-06 0:25 ` query-replace Pedro Sa da Costa
2006-05-06 2:50 ` query-replace Nikos Apostolakis
[not found] ` <mailman.1499.1146875164.9609.help-gnu-emacs@gnu.org>
2006-05-06 2:03 ` query-replace Barry Margolin
2006-05-31 2:26 ` query-replace David Combs
[not found] ` <mailman.1484.1146849219.9609.help-gnu-emacs@gnu.org>
2006-05-06 0:40 ` query-replace Miles Bader
2006-05-08 17:28 ` query-replace Kevin Rodgers
[not found] ` <mailman.1583.1147109410.9609.help-gnu-emacs@gnu.org>
2006-05-31 2:22 ` query-replace David Combs
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).