From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: query-replace-regexp-swap ? Supersedes: <85zmnsylyj.fsf@lola.goethe.zz> Date: Sat, 26 Nov 2005 07:22:03 +0100 Organization: Organization?!? Message-ID: <85u0e0ylmc.fsf@lola.goethe.zz> References: <873blmhk2n.fsf@bzg.ath.cx> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1132986390 17953 80.91.229.2 (26 Nov 2005 06:26:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 26 Nov 2005 06:26:30 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 26 07:26:15 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EftUv-0008W7-87 for geh-help-gnu-emacs@m.gmane.org; Sat, 26 Nov 2005 07:25:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EftUu-0000ok-FG for geh-help-gnu-emacs@m.gmane.org; Sat, 26 Nov 2005 01:25:20 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.cw.net!news-FFM2.ecrc.de!noris.net!newsfeed.arcor.de!news.arcor.de!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Key: sha1:1Cjk4YgV7OwnYikzJyptgFwEdyo= Cancel-Lock: sha1:MJjwjO2X8isR+07WNyOs3Ns52pk= Original-Lines: 22 Original-NNTP-Posting-Date: 26 Nov 2005 07:21:52 MET Original-NNTP-Posting-Host: 0e257b51.newsread2.arcor-online.net Original-X-Trace: DXC=lm3f4V?5b83OjE[7VlJ2<0Q5U85hF6f; 4jW\KbG]kaM8A@_25la3nb28=EM3:0bW601_LiI6ENVa=3>5MOK` List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:31367 Archived-At: [Superseded because of syntax error] Bastien writes: > I often come across this problem: how to swap two strings in a buffer? > For instance, say that you want to exchange #000 and #FFF in an HTML > page: all #000 should become #FFF and all #FFF should become #000. > > How to do this with one *single* function ? If you are using Emacs CVS (which your headers indicate), the following should do the trick: C-M-% #\(\(000\)\|FFF\) RET \,(if \2 "FFF" "000") RET If you want to know how to do this non-interactively, type C-x ESC ESC after the above command. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum