From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oodini Newsgroups: gmane.emacs.help Subject: Re: C formatting Date: Sat, 28 Dec 2002 13:52:53 +0100 Organization: Guest of ProXad - France Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3E0D9EA5.8000306@free.fr> References: <3E0CED7C.7020002@free.fr> <844r8y2yjv.fsf@lucy.cs.uni-dortmund.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1041080114 16410 80.91.224.249 (28 Dec 2002 12:55:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 28 Dec 2002 12:55:14 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18SGUj-0004GR-00 for ; Sat, 28 Dec 2002 13:55:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18SGV3-00025x-00 for gnu-help-gnu-emacs@m.gmane.org; Sat, 28 Dec 2002 07:55:33 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!wanadoo.fr!proxad.net!feeder2-1.proxad.net!news3-2.free.fr!not-for-mail User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: fr-fr, fr Original-Newsgroups: gnu.emacs.help Original-Lines: 54 Original-NNTP-Posting-Date: 28 Dec 2002 13:52:04 MET Original-NNTP-Posting-Host: 212.11.42.3 Original-X-Trace: 1041079924 news3-2.free.fr 22318 212.11.42.3:3145 Original-X-Complaints-To: abuse@proxad.net Original-Xref: shelby.stanford.edu gnu.emacs.help:108539 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5068 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5068 Kai Großjohann a écrit: > I suggest to try C-c C-o on the first line that has wrong indentation > and to follow the prompts. Then hit TAB to reindent the line. When > you like the indentation, you can use C-x ESC ESC and then M-p/M-n to > retrieve the right c-set-offset statement. That's what you can put > in the hook, below: I started from what an user answer here gave me: (add-hook 'c-mode-hook (function (lambda () (c-set-style "bsd") (setq c-basic-offset 4) )) ) and then what what you said: C-x C-o I get the the statement Syntactic symabol to change: substatement I hit Enter... substatement offset (default +): I put 0, and then I get the *wanted behaviour*. C-x ESC ESC redo (c-set-offset (quote substatement) 0 nil) So I modify my .emacs: (add-hook 'c-mode-hook (function (lambda () (c-set-style "bsd") (setq c-basic-offset 4) (c-set-offset 0) )) ) But then I obtain a different behaviour. Typically, after an "if", when I go on a new line to do my opening brace, and hit Tab, the offset is 12 characters (8 char tab, and four characters). > You didn't say which version of Emacs you are using. I'm assuming > Emacs 21. Probably the above works for Emacs 20, too. 21.2.1 -- . . . .:::. ### \|/ ` ___ ' :(o o): . (o o) (o o) - (O o) - ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-