From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Ugly C++ code needs to be reformated - is emacs the right tool? Date: Sat, 08 Dec 2007 13:11:52 +0200 Message-ID: References: <14217366.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1197112385 15615 80.91.229.12 (8 Dec 2007 11:13:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Dec 2007 11:13:05 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 08 12:13:15 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J0xcK-0004cz-9c for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Dec 2007 12:13:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0xc3-0002Ak-1Z for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Dec 2007 06:12:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J0xbl-00026o-Tq for help-gnu-emacs@gnu.org; Sat, 08 Dec 2007 06:12:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J0xbl-00025Y-9t for Help-gnu-emacs@gnu.org; Sat, 08 Dec 2007 06:12:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0xbl-00025G-5q for Help-gnu-emacs@gnu.org; Sat, 08 Dec 2007 06:12:33 -0500 Original-Received: from romy.inter.net.il ([213.8.233.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J0xbk-0002Mp-Sg for Help-gnu-emacs@gnu.org; Sat, 08 Dec 2007 06:12:33 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-84-229-115-66.inter.net.il [84.229.115.66]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id JOO67912 (AUTH halo1); Sat, 8 Dec 2007 13:11:38 +0200 (IST) In-reply-to: <14217366.post@talk.nabble.com> (message from jgombos on Fri, 7 Dec 2007 10:05:34 -0800 (PST)) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor 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:49937 Archived-At: > Date: Fri, 7 Dec 2007 10:05:34 -0800 (PST) > From: jgombos > 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".