From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: luca.pamparana@gmail.com Newsgroups: gmane.emacs.help Subject: bizarre emacs indentation problem Date: Fri, 10 Apr 2009 16:48:30 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1490ae41-1593-4ed2-9b51-a6295d71121b@q9g2000yqc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1239410452 10232 80.91.229.12 (11 Apr 2009 00:40:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Apr 2009 00:40:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 11 02:42:11 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LsRIQ-0005B0-Gq for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Apr 2009 02:42:10 +0200 Original-Received: from localhost ([127.0.0.1]:44376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsRH1-00017R-WD for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Apr 2009 20:40:44 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!q9g2000yqc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: 82.113.121.10 Original-X-Trace: posting.google.com 1239407310 23324 127.0.0.1 (10 Apr 2009 23:48:30 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 10 Apr 2009 23:48:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q9g2000yqc.googlegroups.com; posting-host=82.113.121.10; posting-account=D3FzDwoAAABdMDXitkUrPM9nBOvcbWaj User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/2009032711 Ubuntu/8.10 (intrepid) Firefox/3.0.8, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:168371 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63651 Archived-At: 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