From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: EScott@nyiso.com Newsgroups: gmane.emacs.help Subject: Re: code beautification Date: Thu, 2 Dec 2004 11:28:29 -0500 Message-ID: References: <20041202163247.62977e4a@Woody> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1550076499==" X-Trace: sea.gmane.org 1102007441 21874 80.91.229.6 (2 Dec 2004 17:10:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Dec 2004 17:10:41 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, help-gnu-emacs-bounces+escott=nyiso.com@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 02 18:10:35 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CZtq3-0000oE-00 for ; Thu, 02 Dec 2004 17:29:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CZtzc-0000mi-0t for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Dec 2004 11:39:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CZtzJ-0000gK-Od for help-gnu-emacs@gnu.org; Thu, 02 Dec 2004 11:39:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CZtzI-0000fH-Pb for help-gnu-emacs@gnu.org; Thu, 02 Dec 2004 11:39:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CZtzI-0000ew-H2; Thu, 02 Dec 2004 11:39:24 -0500 Original-Received: from [204.152.47.133] (helo=dommail2.nyiso.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CZtpE-0003Ie-5Z; Thu, 02 Dec 2004 11:29:00 -0500 In-Reply-To: <20041202163247.62977e4a@Woody> Original-To: Thomas Ruschival X-Mailer: Lotus Notes Release 6.5.1 January 21, 2004 X-MIMETrack: Serialize by Router on DomMail2/NYISO(Release 6.51HF99 | March 17, 2004) at 12/02/2004 11:29:00, Serialize complete at 12/02/2004 11:29:00 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: main.gmane.org gmane.emacs.help:22512 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:22512 This is a multipart message in MIME format. --===============1550076499== Content-Type: multipart/alternative; boundary="=_alternative 005A7FEF85256F5E_=" This is a multipart message in MIME format. --=_alternative 005A7FEF85256F5E_= Content-Type: text/plain; charset="US-ASCII" help-gnu-emacs-bounces+escott=nyiso.com@gnu.org wrote on 12/02/2004 10:32:47 AM: > I got a lot of old code that was produced by some IDE. > the IDE used this indentation style > if(1>2) > { > printf("Hello World!"); > } > > I personally prefer the K&R c-style over this and furthermore I have > the habit of putting curly braces after each if,for,while,do I don't > like code like > if (2<3) > printf("hello world"); > > My problem is now I don't know how to build a regexp that works over > several lines with backrefs. > > The "missing" Curly Braces are not important but changing the syle > would be nice. > > Anyone an idea how to reformat code in that way? > > Thomas M-x c-set-style and choose K&R > _______________________________________________ > Help-gnu-emacs mailing list > Help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --=_alternative 005A7FEF85256F5E_= Content-Type: text/html; charset="US-ASCII"
help-gnu-emacs-bounces+escott=nyiso.com@gnu.org wrote on 12/02/2004 10:32:47 AM:

> I got a lot of old code that was produced by some IDE.
> the IDE used this indentation style
> if(1>2)
> {
>    printf("Hello World!");
> }
>
> I personally prefer the K&R c-style over this and furthermore I have
> the habit of putting curly braces after each if,for,while,do I don't
> like code like
> if (2<3)
>    printf("hello world");
>
> My problem is now I don't know how to build a regexp that works over
> several lines with backrefs.
>
> The "missing" Curly Braces are not important but changing the syle
> would be nice.
>
> Anyone an idea how to reformat code in that way?
>
> Thomas


M-x c-set-style

and choose K&R

> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
--=_alternative 005A7FEF85256F5E_=-- --===============1550076499== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============1550076499==--