qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Markus Armbruster <armbru@redhat.com>
Cc: Eric Blake <eblake@redhat.com>,
	Victor Toso <victortoso@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] schemas: add missing vim modeline
Date: Thu, 27 Jan 2022 14:36:21 +0000	[thread overview]
Message-ID: <87lez18at9.fsf@linaro.org> (raw)
In-Reply-To: <87h79pp9va.fsf@dusky.pond.sub.org>


Markus Armbruster <armbru@redhat.com> writes:

> Alex Bennée <alex.bennee@linaro.org> writes:
>
>> Victor Toso <victortoso@redhat.com> writes:
>>
>>> Similar to f7160f3218 "schemas: Add vim modeline"
>>>
>>> Signed-off-by: Victor Toso <victortoso@redhat.com>
>>> ---
>>>  qapi/audio.json  | 1 +
>>>  qapi/compat.json | 1 +
>>>  qapi/replay.json | 1 +
>>>  qapi/trace.json  | 1 +
>>>  4 files changed, 4 insertions(+)
>>>
>>> diff --git a/qapi/audio.json b/qapi/audio.json
>>> index 9cba0df8a4..fe3b506ec3 100644
>>> --- a/qapi/audio.json
>>> +++ b/qapi/audio.json
>>> @@ -1,4 +1,5 @@
>>>  # -*- mode: python -*-
>>> +# vim: filetype=python
>>
>> I realise we have Emacs mode annotations here as well and I'm not going
>> to start a holy war but I thought we used .editorconfig to avoid messing
>> directly with the individual files. So something like:
>>
>>   [*.json]
>>   indent_style = space
>>   emacs_mode = python
>>   vim_filetype = python
>>
>> should also do the job.
>
> Most schema files have lines for both Emacs and vim.  Some have only the
> former, and this patch adds the latter to them.  Seems fair to me.

No argument from me there.

> Perhaps we could get rid of them all instead.  As far as I can tell,
> .editorconfig doesn't work for stock Emacs out of the box, though.

It does require a package-install although fortunately it's in non-gnu
elpa so should work out of the box with any reasonably recent Emacs. I
personally wrap this stuff up in use-package:

  ;; EditorConfig
  (use-package editorconfig
    :ensure t
    :diminish "EdCf"
    :config
    ;; See https://github.com/editorconfig/editorconfig-emacs/issues/246
    (add-to-list 'editorconfig-exclude-modes 'git-rebase-mode)
    (editorconfig-mode 1))

We also have have a rather embryonic .dir-locals in the root of the
source tree as well.

Our vim-brethren seem to have multiple ways of installing their plugin:

  https://github.com/editorconfig/editorconfig-vim#installation

-- 
Alex Bennée


  parent reply	other threads:[~2022-01-27 16:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 14:56 [PATCH] schemas: add missing vim modeline Victor Toso
2021-12-20 15:09 ` Markus Armbruster
2022-01-27 10:20 ` Markus Armbruster
2022-01-27 11:07 ` Alex Bennée
2022-01-27 13:48   ` Markus Armbruster
2022-01-27 14:22     ` Victor Toso
2022-01-27 14:36     ` Alex Bennée [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-03-25 22:16 Victor Toso
2022-03-28 11:48 ` Markus Armbruster
2022-03-28 11:48 ` Markus Armbruster
2022-03-29 16:21 ` John Snow
2022-03-31 10:44 ` Markus Armbruster

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=87lez18at9.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=victortoso@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).