From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dan Jacobson Newsgroups: gmane.emacs.bugs Subject: Re: please implement query-exchange Date: 19 Nov 2002 07:37:59 +0800 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <87heeejvoo.fsf@jidanni.org> References: <87isyynuk3.fsf@jidanni.org> <1438-Sat16Nov2002211425+0200-eliz@is.elta.co.il> <8765uvpx52.fsf@jidanni.org> <9003-Mon18Nov2002210929+0200-eliz@is.elta.co.il> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1037688581 20682 80.91.224.249 (19 Nov 2002 06:49:41 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 19 Nov 2002 06:49:41 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18E2CY-0005NB-00 for ; Tue, 19 Nov 2002 07:49:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18E2E3-0006P7-00; Tue, 19 Nov 2002 01:51:11 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18E2DO-0005PN-00 for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2002 01:50:30 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18E2DK-0005Ko-00 for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2002 01:50:29 -0500 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18E2DJ-0005GI-00 for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2002 01:50:25 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18E2BQ-0005K0-00 for ; Tue, 19 Nov 2002 07:48:28 +0100 Original-To: bug-gnu-emacs@gnu.org X-Injected-Via-Gmane: http://gmane.org/ Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18E2BP-0005Jr-00 for ; Tue, 19 Nov 2002 07:48:27 +0100 Original-Path: 127.0.0.1!nobody Original-Lines: 33 Original-NNTP-Posting-Host: tc218-187-83-244.2-7.pl.apol.com.tw Original-X-Trace: main.gmane.org 1037688507 20121 218.187.83.244 (19 Nov 2002 06:48:27 GMT) Original-X-Complaints-To: usenet@main.gmane.org Original-NNTP-Posting-Date: Tue, 19 Nov 2002 06:48:27 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:3903 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:3903 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 atan(y()-$yc,x()-$xc) is all I am trying to do, by the way. -- http://jidanni.org/ Taiwan(04)25854780