all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: TriKri <kristoferkrus@hotmail.com>
Cc: Help-gnu-emacs@gnu.org
Subject: Re: Indentation settings problems
Date: Wed, 23 Sep 2009 11:15:17 +0000	[thread overview]
Message-ID: <20090923111517.GB2372@muc.de> (raw)
In-Reply-To: <25531038.post@talk.nabble.com>

Hi, TriKri,

On Wed, Sep 23, 2009 at 01:38:35AM -0700, TriKri wrote:

> I added the code (setq-default tab-width 4 indent-tabs-mode t) to the file
> (\AppData\Roaming\.emacs in my user folder in windows) as you said, but it
> doesn't work. If the indentation is made two times (2 times*2 spaces) it
> will insert a tab instead, so that works, and the tab width is set to 4.

> What confuses me is that the variable standard-indent is set to 4 (and C
> Basic Offset is set to Use style settings), but it still indents with two
> spaces! Isn't standard-indent the right variable to change?

CC Mode doesn't use standard-indent at all.  Sadly.  The great thing
about standards is that there're so many to chose from.  ;-)

> I really have no idea of what more could be wrong. The standard-indent
> is said to be 4 by default, but it indented with 2 spaces right from
> the beginning when I had installed Emacs.

The variables you need set are:
c-basic-offset           ; The size of an indentation - set to 4
indent-tabs-mode         ; Tells Emacs to use tabs rather than spaces -
                         ; set to t ("t" is Lisp's symbol for "true").
tab-width                ; How much space a tab character takes up on the
                         ; screen


Unfortunately, setting up CC Mode's "style variables" is too complicated.
If you don't manage to get this sorted now, it would be best if you could
supply "all the evidence" so that we can get it sorted out.  Believe me,
it WILL work.

So, next time round, please
(i) Post your .emacs file.
(ii) Post a (short) C++ source file which illustrates the problems.  Say
  exactly what is wrong with its indentation, and what you want it to
  look like.
(iii) Tell us EXACTLY what you do, after starting Emacs, to show the
  problem.
(iv) Post your CC Mode configuration here.  To get this, do C-c C-b
  (that's "control-c followed by control-b") in your C++ buffer, and cut
  and paste the information into your post.

> -Kristofer

-- 
Alan Mackenzie (Nuremberg, Germany).




  reply	other threads:[~2009-09-23 11:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-19 10:46 Indentation settings problems TriKri
2009-09-20  1:55 ` Bernardo
2009-09-20  2:18   ` Bernardo
2009-09-20 18:37   ` TriKri
2009-09-20 18:55     ` Peter Dyballa
2009-09-20 19:41     ` Andreas Politz
2009-09-24  7:42       ` TriKri
2009-09-20 22:22   ` TriKri
2009-09-21 10:57     ` Bernardo
2009-09-22 18:02     ` TriKri
2009-09-22 22:54       ` Bernardo
     [not found]   ` <mailman.7104.1253471858.2239.help-gnu-emacs@gnu.org>
2009-09-21 21:27     ` jpkotta
2009-09-23  8:38   ` TriKri
2009-09-23 11:15     ` Alan Mackenzie [this message]
2009-10-01 22:44 ` TriKri
2009-10-03  5:45   ` tomas
2009-10-03 19:56 ` TriKri
     [not found] ` <mailman.7953.1254599775.2239.help-gnu-emacs@gnu.org>
2009-10-07 18:57   ` John A Pershing Jr

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=20090923111517.GB2372@muc.de \
    --to=acm@muc.de \
    --cc=Help-gnu-emacs@gnu.org \
    --cc=kristoferkrus@hotmail.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.