For me it worked with:
(add-hook 'c-mode-hook 'gcc-c-mode)
(defun gcc-c-mode()
  ;; set gnu style.
  (c-set-style "gnu")
  ;; TAB offset set to 2
  (setq c-basic-offset 2)
  ;; Tabs should be 8
  (setq indent-tabs-mode t)
  )

Then I simply edit all my software as if it was GCC (haven't found a way to say 
: 'only use this for GCC sources'). I am just missing a good mode for .md files.

Paulo Matos


> -----Original Message-----
> From: David Malcolm [mailto:dmalc...@redhat.com]
> Sent: 16 October 2013 16:33
> To: Paulo Matos
> Cc: Jakub Jelinek; Richard Biener; Paolo Carlini; gcc-patches@gcc.gnu.org
> Subject: Teaching emacs about GCC coding conventions (was Re: [PATCH]
> tree_code_name wrapper)
> 
> On Tue, 2013-10-15 at 13:19 +0000, Paulo Matos wrote:
> > > -----Original Message-----
> > > From: Jakub Jelinek [mailto:ja...@redhat.com]
> > > Sent: 15 October 2013 10:51
> > > To: Paulo Matos
> > > Cc: Richard Biener; Paolo Carlini; gcc-patches@gcc.gnu.org
> > > Subject: Re: [PATCH] tree_code_name wrapper
> > >
> > > On Tue, Oct 15, 2013 at 09:42:17AM +0000, Paulo Matos wrote:
> > > > Thanks, regarding the indentation I was convinced we used 2 space
> > > > indentation with maximum line length of 80 characters.
> > >
> > > We do, however 8 consecutive spaces in the indentation should be always
> > > replaced by a tab.
> > >
> >
> > This means that every sequence of 8 spaces should be converted into tabs? 
> > So,
> if we indent something 4 times, that becomes a tab instead of 4 times 2 
> spaces.
> >
> > Just to confirm so I can setup my emacs to use this.
> 
> Probably a silly question, but what's the invocation in emacs to do
> this, and is it possible to set up the source tree so that this happens
> automatically for everyone?
> 
> (I've been using whitespace-mode and manually copying-and-pasting tab
> characters, which is clearly suboptimal).
> 

Reply via email to