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: Regexp replacement Date: Sun, 29 Oct 2006 01:44:31 +0200 Organization: Organization?!? Message-ID: <85zmbgknts.fsf@lola.goethe.zz> References: <85iri5nzt0.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1162082721 6204 80.91.229.2 (29 Oct 2006 00:45:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 Oct 2006 00:45:21 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 29 02:45:20 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gdyj1-0002XR-FM for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Oct 2006 02:40:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gdyj0-0004lq-Vh for geh-help-gnu-emacs@m.gmane.org; Sat, 28 Oct 2006 20:40:31 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!newsfeed.icl.net!newsfeed.fjserv.net!news-lond.gip.net!news.gsl.net!gip.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!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-Lock: sha1:OOSeU2Wx6OcC0Kq+f0IW0jaZlsc= Original-Lines: 30 Original-NNTP-Posting-Date: 29 Oct 2006 01:45:34 CEST Original-NNTP-Posting-Host: d478d5bc.newsspool2.arcor-online.net Original-X-Trace: DXC=[do9bb>I7gSAX0F2i>\BH3YR58JBlc`bSZTCV`H8_`hhQT^9QSCVg3dOVlR6Na 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:38371 Archived-At: Please don't toppost with fullquote below. If you refer to anything, it is a pain to dig the context up from the bottom, and try to guess what you actually might be referring to. Please cut away anything not relevant to your reply, and put your reply below the stuff you are replying to. Jim Dai writes: > Once again, thanks for the solution. It basically solved my problem. > > Two more questions: > 1) > I wonder if there is an easy improvement on the current method so that I > have nested {} inside the text. No. You need to revert to Elisp in this case and parse the argument using something like forward-sexp. > 2) I did not make it clear when I asked a key binding question. How can I > bind the entire key strokes M-x query-replace-regexp RET > \\redtext{\([^}]*\)} RET \1 RET into an emacs key? > > This key binding is to be used in LaTeX mode. Use C-x Esc Esc after the command in order to get a versino in Elisp. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum