help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you make code look pretty??


From: J. David Boyd
Subject: Re: How do you make code look pretty??
Date: Wed, 27 Jul 2005 16:04:01 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (cygwin)

T Smith <trevorboydsmith@gmail.com> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]