T Smith <[EMAIL PROTECTED]> 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



_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to