[Top][All Lists]

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

Re: please implement query-exchange

From: Dan Jacobson
Subject: Re: please implement query-exchange
Date: 19 Nov 2002 07:37:59 +0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Um, there is some misunderstanding here.  I want someone to add a
command to emacs: (query-exchange "x" "y") which will change all x's
to y's, just like query-replace, but it will also change all y's to
x's at the same time.

Eli on the other hand feels the existing tools with proper instruction
are enough.

I say that adding my nice command is much more convenient for the
simple user than the Eli Boot Camp: It all started when I wanted to
exchange x and y in

>>> atan(x()-$xc,y()-$yc).
Eli> Can't you do that with query-replace-regexp using parenthesized
Eli> subexpressions and the \N feature (where N is a digit)?
>> Maybe you could, and if so maybe you could write up just how one does
>> it and add it to the Info page.  Sounds rather advanced.

Eli> M-x query-replace-regexp RET
Eli> \(x\)\(.*\)\(xc\)\(.*\)\(y\)\(.*\)\(yc\) RET \5\2\7\4\1\6\3 RET

Eli> does this for me.  Is it really advanced?

Naw.  Kid stuff. \5\2\7\4\1\6\3 ? Why of course.  Mom taught that to
me when I was 5 years old.

$ echo 'atan(x()-$xc,y()-$yc)'|tr x B|tr y x|tr B y
is all I am trying to do, by the way.
http://jidanni.org/ Taiwan(04)25854780

reply via email to

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