From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10318 invoked by alias); 10 Sep 2002 15:56:23 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 10217 invoked from network); 10 Sep 2002 15:56:19 -0000 Received: from unknown (HELO gash2.peakpeak.com) (207.174.178.17) by sources.redhat.com with SMTP; 10 Sep 2002 15:56:19 -0000 Received: from fleche.redhat.com (tz0167.peakpeak.com [207.174.69.167]) by gash2.peakpeak.com (8.9.3/8.9.3) with ESMTP id JAA16702; Tue, 10 Sep 2002 09:42:50 -0600 Received: by fleche.redhat.com (Postfix, from userid 1000) id C969C4F80F1; Tue, 10 Sep 2002 09:43:26 -0600 (MDT) To: David Carlton Cc: gdb Subject: Re: naive GDB programming style questions References: From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom X-Zippy: .. I see TOILET SEATS... Date: Tue, 10 Sep 2002 08:56:00 -0000 In-Reply-To: Message-ID: <87u1kxetpd.fsf@fleche.redhat.com> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-09/txt/msg00079.txt.bz2 >>>>> "David" == David Carlton writes: David> 3) Is it possible to get CC Mode to indent in the way that GDB seems David> to prefer? I'm having a hard time getting structs to be indented David> as follows: David> without screwing up my preferred indentation when doing non-GDB David> programming, namely Change your settings depending on the file you are editing. Here is a piece of code I used for this purpose a long time ago. For C source files in a particular directory, it uses the Tcl style (a variant of the BSD style); for other files it uses GNU. Rewrite as appropriate and attach to your c-mode-hook. (defun tjt-set-c-style () (if (and (buffer-file-name) (string-match "/home/syzygy/tclstuff" (buffer-file-name))) (progn (c-set-style "BSD") (make-local-variable 'c-basic-offset) (setq c-basic-offset 4)) (c-set-style "GNU"))) There are probably lots of other ways to accomplish the same thing. And of course you can set anything there; for instance the behavior of electric braces (that sounds like what you want). Tom