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
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 <pit...@world.std.com> in comp.lang.lisp
> 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
> 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
> 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
Which doesn't work if "and" occurs at the beginning or end of a line.
--
Kevin
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.
>
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
> 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, bar...@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 ***
> 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
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
A *very* good idea!
Kevin (since they know you) could you please send
the suggestion to the devel-group?
Thanks!
David
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