From: Eric Blake <eblake@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, "Juan Quintela" <quintela@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Michael Roth" <mdroth@linux.vnet.ibm.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/2] qapi: Rename .json to .qapi
Date: Fri, 20 Apr 2018 08:16:56 -0500 [thread overview]
Message-ID: <fcc5f711-8a54-f7e2-c381-1a9adb4fcd38@redhat.com> (raw)
In-Reply-To: <20180420092700.GC2533@work-vm>
[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]
On 04/20/2018 04:27 AM, Dr. David Alan Gilbert wrote:
> * Markus Armbruster (armbru@redhat.com) wrote:
>> Eric Blake <eblake@redhat.com> writes:
>>
>>> Our QAPI input files aren't quite true JSON (comments being one obvious
>>> difference); naming things .json doesn't make that obvious. Use a new
>>> suffix .qapi that makes it easy to identify our files.
>>
>> I agree that .json is sub-optimal. Evidence: we add Emacs file
>> variables to get Python mode, because that's less wrong than JavaScript
>> mode. Except for "trivial" files, where we can't be bothered.
>>
>> The rename lessens the human confusion, but increases the Editor
>> confusion somewhat: we get Fundamental mode for "trivial" files, which
>> is more wrong than JavaScript mode.
>>
>> One way to avoid that would be adding file variables to all files.
>
> That depends on your editor; this rename makes life **much** better
> in vim; with them as .json files they display with white text on
> bright red background (I guess because it's upset by syntax somewhere)
> but as .qapi files it's readable (I'm not entirely sure which syntax
> it's using)
It's also possible to document that emacs users can add to their .emacs
file:
(add-to-list 'auto-mode-alist '("\\.qapi\\'" . python-mode))
to automatically treat all .qapi files with sane highlighting. Sadly,
.dir-locals.el cannot do this without warning the users about an unsafe
'eval' variable, so users that don't do their own manual setup are stuck
with fundamental mode on trivial files.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2018-04-20 13:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-19 22:31 [Qemu-devel] [PATCH v2 0/2] QAPI file renames Eric Blake
2018-04-19 22:31 ` [Qemu-devel] [PATCH v2 1/2] qapi: Rename QMP and QGA schema files Eric Blake
2018-04-20 8:01 ` Markus Armbruster
2018-04-20 12:42 ` Eric Blake
2018-04-19 22:31 ` [Qemu-devel] [PATCH v2 2/2] qapi: Rename .json to .qapi Eric Blake
2018-04-20 8:35 ` Markus Armbruster
2018-04-20 9:27 ` Dr. David Alan Gilbert
2018-04-20 13:16 ` Eric Blake [this message]
2018-04-20 9:46 ` Dr. David Alan Gilbert
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=fcc5f711-8a54-f7e2-c381-1a9adb4fcd38@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@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;
as well as URLs for NNTP newsgroup(s).