From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] Add .dir-locals.el file to configure emacs coding style
Date: Tue, 15 Sep 2015 09:31:08 -0600 [thread overview]
Message-ID: <55F839BC.8060409@redhat.com> (raw)
In-Reply-To: <55DBB3B8.9080807@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]
ping
On 08/24/2015 06:15 PM, John Snow wrote:
>
>
> On 06/18/2015 10:05 AM, Markus Armbruster wrote:
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>
>>> On 18 June 2015 at 10:28, Markus Armbruster <armbru@redhat.com> wrote:
>>>> However, I can't see how I could define a new C style there without
>>>> pushing the "local variables" feature well beyond its intended use, and
>>>> triggering the confirmation prompts.
>>>
>>> We wouldn't want to define a new C style, but in general the items
>>> I have in my config over the Stroustrup defaults are going to be there
>>> because I've noticed something where Stroustrup doesn't indent right...
>>
>> As far as I can see, the difference bwteen stroustrup style and yours is
>> a few tweaks to c-offsets-alist and c-hanging-braces-alist. I'm not
>> sure how to do that from .dir-locals.el.
>>
>>>> If we take Dan's patch, every Emacs user who hasn't already configured a
>>>> suitable style profits. Users who have may have to adjust their
>>>> configuration to work with or around Dan's patch.
>>>
>>> Is there some way to tell whether your emacs has picked up the local
>>> style info rather than the one you have in your .emacs ?
>>
>> The obvious way is to check the buffer-local variables. Buffer-local
>> variable c-indentation-style is the name of the style in use. Without
>> anything in .emacs or local variables, it's "gnu". With your
>> (c-add-style "qemu" qemu-c-style) in .emacs, it should be "qemu". With
>> Dan's .dir-locals.el, it should be "stroustrup".
>>
>> When you can't or don't want to create or modify a .dir-locals.el, you
>> can do something like this instead:
>>
>> (dir-locals-set-class-variables 'qemu '((c-mode . ((c-file-style . "qemu")))))
>> (dir-locals-set-directory-class "~/work/qemu" 'qemu)
>>
>> This *overrides* .dir-locals.el in my testing.
>>
>
> ping -- any love for this for 2.5?
>
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-09-15 15:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-04 13:30 [Qemu-devel] [PATCH v2] Add .dir-locals.el file to configure emacs coding style Daniel P. Berrange
2015-06-04 13:41 ` Peter Maydell
2015-06-04 14:15 ` Daniel P. Berrange
2015-06-18 9:28 ` Markus Armbruster
2015-06-18 12:47 ` Peter Maydell
2015-06-18 14:05 ` Markus Armbruster
2015-08-25 0:15 ` John Snow
2015-09-15 15:31 ` Eric Blake [this message]
2015-09-15 15:54 ` Daniel P. Berrange
2015-09-15 16:22 ` Markus Armbruster
2015-09-15 17:53 ` Michael Tokarev
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=55F839BC.8060409@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=jsnow@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).