all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: david@adboyd.com (J. David Boyd)
Subject: Re: How do you make code look pretty??
Date: Wed, 27 Jul 2005 16:04:01 -0400	[thread overview]
Message-ID: <81zms8uiby.fsf@adboyd.com> (raw)
In-Reply-To: 4548740a05072709476c2bbd92@mail.gmail.com

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	other threads:[~2005-07-27 20:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-27 16:47 How do you make code look pretty?? T Smith
2005-07-27 20:04 ` J. David Boyd [this message]
     [not found] ` <mailman.1921.1122495039.20277.help-gnu-emacs@gnu.org>
2005-07-27 20:24   ` Pascal Bourguignon
     [not found] <mailman.1905.1122483652.20277.help-gnu-emacs@gnu.org>
2005-07-27 17:40 ` Pascal Bourguignon
2005-07-27 18:49   ` David Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81zms8uiby.fsf@adboyd.com \
    --to=david@adboyd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.