This is the mail archive of the
mailing list for the GCC project.
Re: Teaching emacs about GCC coding conventions (was Re: [PATCH] tree_code_name wrapper)
- From: Mike Stump <mikestump at comcast dot net>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Andreas Schwab <schwab at suse dot de>, "Paulo Matos" <pmatos at broadcom dot com>, "David Malcolm" <dmalcolm at redhat dot com>, "Jakub Jelinek" <jakub at redhat dot com>, "Richard Biener" <richard dot guenther at gmail dot com>, "Paolo Carlini" <paolo dot carlini at oracle dot com>, "gcc-patches\ at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 16 Oct 2013 11:32:59 -0700
- Subject: Re: Teaching emacs about GCC coding conventions (was Re: [PATCH] tree_code_name wrapper)
- Authentication-results: sourceware.org; auth=none
- References: <19EB96622A777C4AB91610E763265F462DC5C7 at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <525C1786 dot 5030404 at oracle dot com> <CAFiYyc0b7fU=L28_rkfo4x0zQ-wkf=tr+APMuXd3DVNw5FGAHQ at mail dot gmail dot com> <19EB96622A777C4AB91610E763265F462DC8D3 at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <20131015095055 dot GM30970 at tucnak dot zalov dot cz> <19EB96622A777C4AB91610E763265F462DDBA3 at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <1381937561 dot 25101 dot 9 dot camel at surprise> <19EB96622A777C4AB91610E763265F462DEFD4 at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <mvmsiw19pnq dot fsf at hawking dot suse dot de> <87li1tw5b6 dot fsf at fleche dot redhat dot com>
On Oct 16, 2013, at 9:26 AM, Tom Tromey <firstname.lastname@example.org> wrote:
> Andreas> You could put it in .dir-locals.el, or put a hook on
> Andreas> find-file-hook that looks at buffer-file-name.
> We checked in a .dir-locals.el for gdb. I recommend it for GCC as well.
I've copied the gdb one and updated it for our tree:
$ cat .dir-locals.el
;; Emacs settings.
;; Copyright (C) 2012-2013 Free Software Foundation, Inc.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(tcl-mode . ((tcl-indent-level . 4)
(tcl-continued-indent-level . 4)
(indent-tabs-mode . t)))
(nil . ((bug-reference-url-format . "http://gcc.gnu.org/PR%s")))
(c-mode . ((c-file-style . "GNU")
(indent-tabs-mode . t)))
Committed revision 203715.
I've tested it to ensure everything works as expected, except I didn't see exactly how to test the bug-reference… If someone knows how to test that, I'd appreciate it. If I understand the net result of this, it should make the lives of people that work on multiple trees with different formatting easier.
Now, if you've been manually fidgeting with tab characters, you should be able to just hit tab on the line your editing and have it do the right thing (if your emacs isn't really old).