* Search and replace enclosing \commands{word}
@ 2009-01-11 14:31 sharky
2009-01-11 15:25 ` Teemu Likonen
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: sharky @ 2009-01-11 14:31 UTC (permalink / raw)
To: help-gnu-emacs
Hi!
I'm using emacs to write LaTeX code, which means I have a lot of stuff
that looks like this:
\section{Headline}
Blah blah yada yada \textit{italic yada} and the yada yada \textbf
{bold yada} and then \myspecial{yada}.
You get the picture. I wanna search and delete the enclosing thingy,
like so:
\myspecial{yada} -----> yada
Is there a way to do this in emacs?
Please help!
/Sharky
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Search and replace enclosing \commands{word}
2009-01-11 14:31 Search and replace enclosing \commands{word} sharky
@ 2009-01-11 15:25 ` Teemu Likonen
2009-01-11 19:53 ` Peter Milliken
[not found] ` <mailman.4573.1231703627.26697.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 4+ messages in thread
From: Teemu Likonen @ 2009-01-11 15:25 UTC (permalink / raw)
To: help-gnu-emacs
sharky (2009-01-11 06:31 -0800) wrote:
> \myspecial{yada} -----> yada
You can use query-replace-regexp (C-M-%):
Query replace regexp: \\myspecial{\([^}]*\)}
with: \1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Search and replace enclosing \commands{word}
2009-01-11 14:31 Search and replace enclosing \commands{word} sharky
2009-01-11 15:25 ` Teemu Likonen
@ 2009-01-11 19:53 ` Peter Milliken
[not found] ` <mailman.4573.1231703627.26697.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 4+ messages in thread
From: Peter Milliken @ 2009-01-11 19:53 UTC (permalink / raw)
To: sharky; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 667 bytes --]
Yes, read the help sections on regular expression search and replace. You
can "capture" the text between the {}'s and keep it without losing it (read
up on submatches).
On Mon, Jan 12, 2009 at 1:31 AM, sharky <landhaj@yahoo.com> wrote:
> Hi!
>
> I'm using emacs to write LaTeX code, which means I have a lot of stuff
> that looks like this:
>
> \section{Headline}
>
> Blah blah yada yada \textit{italic yada} and the yada yada \textbf
> {bold yada} and then \myspecial{yada}.
>
> You get the picture. I wanna search and delete the enclosing thingy,
> like so:
>
> \myspecial{yada} -----> yada
>
> Is there a way to do this in emacs?
>
> Please help!
>
> /Sharky
>
[-- Attachment #2: Type: text/html, Size: 1021 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Search and replace enclosing \commands{word}
[not found] ` <mailman.4573.1231703627.26697.help-gnu-emacs@gnu.org>
@ 2009-01-17 20:20 ` sharky
0 siblings, 0 replies; 4+ messages in thread
From: sharky @ 2009-01-17 20:20 UTC (permalink / raw)
To: help-gnu-emacs
Thank you both! This is a very powerful tool indeed!
/Sharky
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-17 20:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-11 14:31 Search and replace enclosing \commands{word} sharky
2009-01-11 15:25 ` Teemu Likonen
2009-01-11 19:53 ` Peter Milliken
[not found] ` <mailman.4573.1231703627.26697.help-gnu-emacs@gnu.org>
2009-01-17 20:20 ` sharky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).