Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: David Carlton <carlton@math.stanford.edu>
Cc: gdb <gdb@sources.redhat.com>
Subject: Re: naive GDB programming style questions
Date: Tue, 10 Sep 2002 08:56:00 -0000	[thread overview]
Message-ID: <87u1kxetpd.fsf@fleche.redhat.com> (raw)
In-Reply-To: <ro1u1kyah7d.fsf@jackfruit.Stanford.EDU>

>>>>> "David" == David Carlton <carlton@math.stanford.edu> 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


      parent reply	other threads:[~2002-09-10 15:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-09 16:14 David Carlton
2002-09-09 18:45 ` Andrew Cagney
2002-09-09 20:52   ` David Carlton
2002-09-10 11:39     ` David Carlton
2002-09-10 16:15       ` Andrew Cagney
2002-09-12 11:35     ` Andrew Cagney
2002-09-10  8:56 ` Tom Tromey [this message]

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=87u1kxetpd.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=carlton@math.stanford.edu \
    --cc=gdb@sources.redhat.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox