This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [commit] Deprecate remaining STREQ uses
- From: "Eli Zaretskii" <eliz at elta dot co dot il>
- To: Andrew Cagney <cagney at gnu dot org>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 05 Dec 2003 19:55:10 +0200
- Subject: Re: [commit] Deprecate remaining STREQ uses
- References: <3FC119EB.1060102@gnu.org> <ufzgee29u.fsf@elta.co.il> <3FC234C0.1000500@gnu.org> <2914-Mon24Nov2003212333+0200-eliz@elta.co.il> <yf2r7zxy1j3.fsf@hawaii.kealia.com> <uznelos2i.fsf@elta.co.il> <3FD0B1B8.4030807@gnu.org>
- Reply-to: Eli Zaretskii <eliz at elta dot co dot il>
> Date: Fri, 05 Dec 2003 11:26:32 -0500
> From: Andrew Cagney <cagney@gnu.org>
>
> Is there a way, in EMACS, to pipe a section of code through a shell and
> then have that code re-inserted in place?
There's a way in Emacs to do everything (well, perhaps except a cup
of coffee ;-).
You want "C-u M-|", I think. See the doc string of
shell-command-on-region (bound to M-|) for more details.
> I've played with c-macro-expand but found the experience less than
> satisfying. The text ends up in a separate window leaving me with an
> additional messy cut/paste step.
It sounds like you missed the documentation of c-macro-expand, which
says:
c-macro-expand is an interactive autoloaded Lisp function in `cmacexp'.
(c-macro-expand START END SUBST)
Expand C macros in the region, using the C preprocessor.
Normally display output in temp buffer, but
prefix arg means replace the region with it.
Note the last sentence: it means that "C-u M-x c-macro-expand RET"
will replace the marked region with the results of the expansion.
> PS: Steps will likely be:
>
> - change streq[n] to sane equivalents
> - re-indent rougly half of GDB
> the output of cpp is messy, I'm going to need to re-indent it, which
> means I'm going to need to re-indent befor the event
> - this to-be-determined step
For reindenting, just mark the region and then type "C-M-\".