all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: luca.pamparana@gmail.com
To: help-gnu-emacs@gnu.org
Subject: bizarre emacs indentation problem
Date: Fri, 10 Apr 2009 16:48:30 -0700 (PDT)	[thread overview]
Message-ID: <1490ae41-1593-4ed2-9b51-a6295d71121b@q9g2000yqc.googlegroups.com> (raw)

Hello,

I have a bizarre emacs indentation problem in the C++ mode. My C++
settings look as follows:

(defun my-c++-mode-hook ()
  (c-set-offset 'substatement-open 0)
  (setq indent-tabs-mode nil)
  (setq tab-width 4)
  (define-key c++-mode-map "\C-m" 'reindent-then-newline-and-indent)
  (define-key c++-mode-map "\C-ce" 'c-comment-edit)
  (setq c++-auto-hungry-initial-state 'none)
  (setq c++-delete-function 'backward-delete-char)
  (setq c++-tab-always-indent nil)
  (setq tab-stop-list '(4 8 12 16))
  (setq c-basic-offset 4)
  (setq c-indent-level 4)
  (setq c-continued-statement-offset 4)
  (setq c++-empty-arglist-indent 4))


;; Add all of the hooks...
(add-hook 'c++-mode-hook 'my-c++-mode-hook)
(add-hook 'c++-mode-hook 'turn-on-auto-fill)
(setq default-major-mode 'c++-mode)
(setq column-number-mode t)

As you can see, I have set the substatement open parameter to 0, so it
should not indent after the statement braces. However, it always
indents by 1. So, my sample if clause looks as follows:

if(something)
 {
 }

As you can see, the braces are indented by 1 space. This is driving me
crazy!

Does anyone have any idea why I might be getting this?

Many thanks,

Luca


             reply	other threads:[~2009-04-10 23:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-10 23:48 luca.pamparana [this message]
2009-04-11 21:29 ` bizarre emacs indentation problem Alan Mackenzie

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=1490ae41-1593-4ed2-9b51-a6295d71121b@q9g2000yqc.googlegroups.com \
    --to=luca.pamparana@gmail.com \
    --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.
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.