* Ugly C++ code needs to be reformated - is emacs the right tool?
@ 2007-12-07 18:05 jgombos
2007-12-08 11:11 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: jgombos @ 2007-12-07 18:05 UTC (permalink / raw)
To: Help-gnu-emacs
New coding standard mandate forces 80 column limit (puke). So I need a tool
to split long lines intelligently, so clean and readable breaks are made.
The code is rough looking in other ways, because I've run some
non-interactive sed scripts on it to do some replacements, so the resulting
code is almost as ugly as machine generated code.
I need an industrial strength pretty printer (though I hate to call it that
because it implies the output is a publication). Is there any way to make
emacs do this? I'm not interested in starting a lisp project, but if
there's some code out there I can grab, that would be excellent.
I tried to use Artistic Style (astyle), and it's just not manipulative
enough. It will fix indentations, but doesn't split lengthy lines, and
doesn't mess with intra-statement whitespace.
Tidy does a great job of taking very messy HTML and making it readable. So
something along those lines but for C++ would be great. I'm not too picky
about formatting details.. any of the mainstream styles are fine
(BSD/Allman, Whitesmith, K&R..)
--
View this message in context: http://www.nabble.com/Ugly-C%2B%2B-code-needs-to-be-reformated---is-emacs-the-right-tool--tf4963486.html#a14217366
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Ugly C++ code needs to be reformated - is emacs the right tool?
2007-12-07 18:05 Ugly C++ code needs to be reformated - is emacs the right tool? jgombos
@ 2007-12-08 11:11 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2007-12-08 11:11 UTC (permalink / raw)
To: Help-gnu-emacs
> Date: Fri, 7 Dec 2007 10:05:34 -0800 (PST)
> From: jgombos <nabble.forum.jog@spamgourmet.com>
> Cc:
>
> New coding standard mandate forces 80 column limit (puke). So I need a tool
> to split long lines intelligently, so clean and readable breaks are made.
> The code is rough looking in other ways, because I've run some
> non-interactive sed scripts on it to do some replacements, so the resulting
> code is almost as ugly as machine generated code.
>
> I need an industrial strength pretty printer (though I hate to call it that
> because it implies the output is a publication). Is there any way to make
> emacs do this?
There probably is, but how about posting a sample of the ugly code
together with what you'd like it to become? Then Someone(TM) could
advise you how to set up various options in C Mode to reformat the
code to your liking. Also, how many lines are in the code you want to
reformat?
In general, you will probably need to use "C-M-\" followed by "M-q".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-08 11:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-07 18:05 Ugly C++ code needs to be reformated - is emacs the right tool? jgombos
2007-12-08 11:11 ` Eli Zaretskii
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).