unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Colin S. Miller" <no-spam-thank-you@csmiller.demon.co.uk>
To: help-gnu-emacs@gnu.org
Subject: Re: emacs new user.
Date: Tue, 25 Sep 2007 22:52:10 +0100	[thread overview]
Message-ID: <46f9830a$0$90272$14726298@news.sunsite.dk> (raw)
In-Reply-To: <mailman.1249.1190671281.18990.help-gnu-emacs@gnu.org>

Moofar wrote:
> Your responses have been very welcome. Just knowing that there is an active
> forum on the internet makes a huge difference. I have been reading the help
> files and I know I just need to keep on reading and learning. 
> 
> I do have one question that would just be very helpful to get me started. I
> am working on a file in C, xxx.c and the auto indentation feature is not
> working or not turned on. The c mode is enabled and other functions are
> working. I'm reading about the c mode options and options in general through
> in the documentation to figure it out, but an easy answer would be a huge
> help.

Moofar,

Adding this to your .emacs file might help

(add-hook 'c-mode-common-hook '(lambda ()
                                  (c-set-style "whitesmith")
                                  (turn-on-auto-fill)
                                  (turn-on-font-lock)
                                  (setq fill-column 77)
                                  (setq indent-tabs-mode nil)
                                  (flyspell-prog-mode)
                                 ))


This changes c-mode to
1) Whitesmith indent style; this has the curly brackets on their own line,
and lined-up with the preceding control block, indent is the default of 4 characters.

2) Autoindent is enabled; the next line will default to the correct indentation when you press enter.
3) Syntax highlighting is enabled
4) Code auto-wraps to the next line at 77 characters
5) Spaces are used instead of tab characters for indenting
6) Spell checking is enabled (if ispell/aspell is installed; it will be on unix systems but not MS-Windows systems)


This is for XEmacs; it should work on GNU Emacs, but I can't guarantee this.

HTH,
Colin S. Miller

-- 
Replace the obvious in my email address with the first three letters of the hostname to reply.

  parent reply	other threads:[~2007-09-25 21:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-24 16:46 emacs new user Moofar
2007-09-24 18:21 ` Leo
2007-09-24 18:37 ` Drew Adams
2007-09-24 18:48 ` Bastien
2007-09-24 22:01 ` Moofar
2007-09-25  4:05   ` Eli Zaretskii
2007-09-24 22:37 ` Moofar
     [not found] ` <mailman.1249.1190671281.18990.help-gnu-emacs@gnu.org>
2007-09-25 21:52   ` Colin S. Miller [this message]
2008-02-10 11:07     ` Stefan Arentz
     [not found] <mailman.1229.1190657525.18990.help-gnu-emacs@gnu.org>
2007-09-24 19:20 ` Thien-Thi Nguyen
2007-09-24 20:46 ` Ken Goldman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='46f9830a$0$90272$14726298@news.sunsite.dk' \
    --to=no-spam-thank-you@csmiller.demon.co.uk \
    --cc=help-gnu-emacs@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).