[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regexp/emacs selective replace
From: |
Barry Margolin |
Subject: |
Re: regexp/emacs selective replace |
Date: |
Tue, 24 Nov 2009 20:30:25 -0500 |
User-agent: |
MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
In article <mailman.11424.1259102060.2239.help-gnu-emacs@gnu.org>,
m121212 <m121212@mailinator.com> wrote:
> Hi,
>
> I have a tricky problem that I'm not sure how to solve. I have a latex
> document with several figure environments that look like this:
>
> \begin{figure}
> \includegraphics{blah.ps}
> \end{figure}
>
> but need to look like this:
>
> \begin{figure}
> \begin{center} \includegraphics{blah.ps} \end{center}
> \end{figure}
>
> Some of the figure environments already have this however, and I don't want
> to end up with something like this:
>
> \begin{figure}
> \begin{center}\begin{center} \includegraphics{blah.ps}
> \end{center}\end{center}
> \end{figure}
>
> Any ideas?
Does query-replace-regexp do what you want? It will prompt you before
each possible replacement, and you can say whether to replace that
instance.
--
Barry Margolin, barmar@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 ***
Re: regexp/emacs selective replace, Xah Lee, 2009/11/27