All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] schemas: add missing vim modeline
@ 2021-12-20 14:56 Victor Toso
  2021-12-20 15:09 ` Markus Armbruster
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Victor Toso @ 2021-12-20 14:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Eric Blake, Markus Armbruster

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
 #
 # Copyright (C) 2015-2019 Zoltán Kővágó <DirtY.iCE.hu@gmail.com>
 #
diff --git a/qapi/compat.json b/qapi/compat.json
index dd7261ae2a..c53b69fe3f 100644
--- a/qapi/compat.json
+++ b/qapi/compat.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = Compatibility policy
diff --git a/qapi/replay.json b/qapi/replay.json
index bfd83d7591..b4d1ba253b 100644
--- a/qapi/replay.json
+++ b/qapi/replay.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/trace.json b/qapi/trace.json
index eedfded512..119509f565 100644
--- a/qapi/trace.json
+++ b/qapi/trace.json
@@ -1,4 +1,5 @@
 # -*- mode: python -*-
+# vim: filetype=python
 #
 # Copyright (C) 2011-2016 Lluís Vilanova <vilanova@ac.upc.edu>
 #
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] schemas: add missing vim modeline
  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
  2 siblings, 0 replies; 12+ messages in thread
From: Markus Armbruster @ 2021-12-20 15:09 UTC (permalink / raw)
  To: Victor Toso; +Cc: Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> Similar to f7160f3218 "schemas: Add vim modeline"
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>

Acked-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] schemas: add missing vim modeline
  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
  2 siblings, 0 replies; 12+ messages in thread
From: Markus Armbruster @ 2022-01-27 10:20 UTC (permalink / raw)
  To: Victor Toso; +Cc: Eric Blake, qemu-devel, Markus Armbruster

Queued.  Thanks!



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] schemas: add missing vim modeline
  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
  2 siblings, 1 reply; 12+ messages in thread
From: Alex Bennée @ 2022-01-27 11:07 UTC (permalink / raw)
  To: Victor Toso; +Cc: Eric Blake, Markus Armbruster, qemu-devel


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.

>  #
>  # Copyright (C) 2015-2019 Zoltán Kővágó <DirtY.iCE.hu@gmail.com>
>  #
> diff --git a/qapi/compat.json b/qapi/compat.json
> index dd7261ae2a..c53b69fe3f 100644
> --- a/qapi/compat.json
> +++ b/qapi/compat.json
> @@ -1,4 +1,5 @@
>  # -*- Mode: Python -*-
> +# vim: filetype=python
>  
>  ##
>  # = Compatibility policy
> diff --git a/qapi/replay.json b/qapi/replay.json
> index bfd83d7591..b4d1ba253b 100644
> --- a/qapi/replay.json
> +++ b/qapi/replay.json
> @@ -1,4 +1,5 @@
>  # -*- Mode: Python -*-
> +# vim: filetype=python
>  #
>  
>  ##
> diff --git a/qapi/trace.json b/qapi/trace.json
> index eedfded512..119509f565 100644
> --- a/qapi/trace.json
> +++ b/qapi/trace.json
> @@ -1,4 +1,5 @@
>  # -*- mode: python -*-
> +# vim: filetype=python
>  #
>  # Copyright (C) 2011-2016 Lluís Vilanova <vilanova@ac.upc.edu>
>  #


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] schemas: add missing vim modeline
  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
  0 siblings, 2 replies; 12+ messages in thread
From: Markus Armbruster @ 2022-01-27 13:48 UTC (permalink / raw)
  To: Alex Bennée; +Cc: Eric Blake, Victor Toso, qemu-devel

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.

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.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] schemas: add missing vim modeline
  2022-01-27 13:48   ` Markus Armbruster
@ 2022-01-27 14:22     ` Victor Toso
  2022-01-27 14:36     ` Alex Bennée
  1 sibling, 0 replies; 12+ messages in thread
From: Victor Toso @ 2022-01-27 14:22 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Eric Blake, Alex Bennée, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]

On Thu, Jan 27, 2022 at 02:48:57PM +0100, Markus Armbruster wrote:
> 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.
> 
> 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.

I think the same is true for vim. You need to enable a plugin for
it. Similar to other IDEs.

If we have a formal way to suggest that developers install
editorconfig plugin for their IDE it would be better than
maintaining such annotations.

Cheers,
Victor

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] schemas: add missing vim modeline
  2022-01-27 13:48   ` Markus Armbruster
  2022-01-27 14:22     ` Victor Toso
@ 2022-01-27 14:36     ` Alex Bennée
  1 sibling, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2022-01-27 14:36 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Eric Blake, Victor Toso, qemu-devel


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] schemas: add missing vim modeline
  2022-03-25 22:16 Victor Toso
                   ` (2 preceding siblings ...)
  2022-03-29 16:21 ` John Snow
@ 2022-03-31 10:44 ` Markus Armbruster
  3 siblings, 0 replies; 12+ messages in thread
From: Markus Armbruster @ 2022-03-31 10:44 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> This is the last qapi schema that is missing the modeline.
> Fixes 7e7237cd2b "schemas: add missing vim modeline"
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>

Queued, thanks!



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] schemas: add missing vim modeline
  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
  3 siblings, 0 replies; 12+ messages in thread
From: John Snow @ 2022-03-29 16:21 UTC (permalink / raw)
  To: Victor Toso; +Cc: Eric Blake, qemu-devel, Markus Armbruster

On Fri, Mar 25, 2022 at 6:16 PM Victor Toso <victortoso@redhat.com> wrote:
>
> This is the last qapi schema that is missing the modeline.
> Fixes 7e7237cd2b "schemas: add missing vim modeline"
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/pragma.json | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/qapi/pragma.json b/qapi/pragma.json
> index 3bc0335d1f..e6a021c19c 100644
> --- a/qapi/pragma.json
> +++ b/qapi/pragma.json
> @@ -1,3 +1,6 @@
> +# -*- Mode: Python -*-
> +# vim: filetype=python
> +
>  { 'pragma': { 'doc-required': true } }
>
>  # Whitelists to permit QAPI rule violations; think twice before you
> --
> 2.35.1
>

Reviewed-by: John Snow <jsnow@redhat.com>

thanks!



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] schemas: add missing vim modeline
  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
  3 siblings, 0 replies; 12+ messages in thread
From: Markus Armbruster @ 2022-03-28 11:48 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> This is the last qapi schema that is missing the modeline.
> Fixes 7e7237cd2b "schemas: add missing vim modeline"
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] schemas: add missing vim modeline
  2022-03-25 22:16 Victor Toso
@ 2022-03-28 11:48 ` Markus Armbruster
  2022-03-28 11:48 ` Markus Armbruster
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Markus Armbruster @ 2022-03-28 11:48 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel, Markus Armbruster

Victor Toso <victortoso@redhat.com> writes:

> This is the last qapi schema that is missing the modeline.
> Fixes 7e7237cd2b "schemas: add missing vim modeline"
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/pragma.json | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/qapi/pragma.json b/qapi/pragma.json
> index 3bc0335d1f..e6a021c19c 100644
> --- a/qapi/pragma.json
> +++ b/qapi/pragma.json
> @@ -1,3 +1,6 @@
> +# -*- Mode: Python -*-
> +# vim: filetype=python
> +
>  { 'pragma': { 'doc-required': true } }
>  
>  # Whitelists to permit QAPI rule violations; think twice before you



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] schemas: add missing vim modeline
@ 2022-03-25 22:16 Victor Toso
  2022-03-28 11:48 ` Markus Armbruster
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Victor Toso @ 2022-03-25 22:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

This is the last qapi schema that is missing the modeline.
Fixes 7e7237cd2b "schemas: add missing vim modeline"

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/pragma.json | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qapi/pragma.json b/qapi/pragma.json
index 3bc0335d1f..e6a021c19c 100644
--- a/qapi/pragma.json
+++ b/qapi/pragma.json
@@ -1,3 +1,6 @@
+# -*- Mode: Python -*-
+# vim: filetype=python
+
 { 'pragma': { 'doc-required': true } }
 
 # Whitelists to permit QAPI rule violations; think twice before you
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-03-31 10:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.