From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: david@adboyd.com (J. David Boyd) Newsgroups: gmane.emacs.help Subject: Re: How do you make code look pretty?? Date: Wed, 27 Jul 2005 16:04:01 -0400 Message-ID: <81zms8uiby.fsf@adboyd.com> References: <4548740a05072709476c2bbd92@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1122494952 8799 80.91.229.2 (27 Jul 2005 20:09:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Jul 2005 20:09:12 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 27 22:09:10 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DxsCX-000286-66 for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jul 2005 22:08:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DxsEw-0002NY-LR for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jul 2005 16:10:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DxsEc-0002Li-UK for help-gnu-emacs@gnu.org; Wed, 27 Jul 2005 16:10:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DxsEa-0002KT-Ja for help-gnu-emacs@gnu.org; Wed, 27 Jul 2005 16:10:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DxsEa-0002Jo-EC for help-gnu-emacs@gnu.org; Wed, 27 Jul 2005 16:10:32 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DxsKe-0005uL-W7 for help-gnu-emacs@gnu.org; Wed, 27 Jul 2005 16:16:49 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Dxs8u-0001Tp-P5 for help-gnu-emacs@gnu.org; Wed, 27 Jul 2005 22:04:40 +0200 Original-Received: from rrcs-67-78-201-138.se.biz.rr.com ([67.78.201.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Jul 2005 22:04:40 +0200 Original-Received: from david by rrcs-67-78-201-138.se.biz.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Jul 2005 22:04:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 33 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: rrcs-67-78-201-138.se.biz.rr.com User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (cygwin) Cancel-Lock: sha1:nyn1F2diKPv1dtgSijuYgdrvmTc= 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:28235 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:28235 T Smith writes: > Dear emacs helpers, > > My question is what commands will format the code to look nice? I know of > the "indent" command but it only seems to do uniform indenting for all the > code. What I am asking for is something that does the indenting and auto > edits the code to make it look a little more pretty. I would say that, if you are really picky about how your code looks, then you should prepare yourself for disappointment. I've never seen any utility that indents code *exactly* the way I would like it, so I've just learned to live with what emacs does. I don't want to have to run some third party app to indent my code. And actually, after a while, you get used to what emacs does. It is quit configurable, if you play around with the offsets of the different sections of the code. Here's three things I've put into my c-mode-hook, that I think really help: (c-set-style "user") (c-set-offset 'case-label '+) (c-set-offset 'substatement-open 0) Read the docs, there is much you can do inside of emacs itself. Dave in Largo, FL