All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu: add .exrc
@ 2012-07-19 14:29 Michael S. Tsirkin
  2012-07-19 15:11 ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2012-07-19 14:29 UTC (permalink / raw)
  To: qemu-devel, Anthony Liguori; +Cc: Michael S. Tsirkin

I've been using this to get correct indenting with vim
in qemu for a while, but it's a bit easier if we
put the settings in the central place.
Note that
1. you still need to enable 'exrc' and 'secure'
   options in your vimrc for these settings to take effect.
2. you can create a .vimrc file if 'exrc' is on but there's
   need to bypass this configuration.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 .exrc | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 .exrc

diff --git a/.exrc b/.exrc
new file mode 100644
index 0000000..1853616
--- /dev/null
+++ b/.exrc
@@ -0,0 +1,3 @@
+set expandtab
+set shiftwidth=4
+set smarttab
-- 
MST

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

* Re: [Qemu-devel] [PATCH] qemu: add .exrc
  2012-07-19 14:29 [Qemu-devel] [PATCH] qemu: add .exrc Michael S. Tsirkin
@ 2012-07-19 15:11 ` Peter Maydell
  2012-07-19 15:24   ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Maydell @ 2012-07-19 15:11 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel, Anthony Liguori

On 19 July 2012 15:29, Michael S. Tsirkin <mst@redhat.com> wrote:
> I've been using this to get correct indenting with vim
> in qemu for a while, but it's a bit easier if we
> put the settings in the central place.
> Note that
> 1. you still need to enable 'exrc' and 'secure'
>    options in your vimrc for these settings to take effect.
> 2. you can create a .vimrc file if 'exrc' is on but there's
>    need to bypass this configuration.

I think editor configs could reasonably go on the wiki somewhere
but I'm not sure they belong in our git repo...

-- PMM

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

* Re: [Qemu-devel] [PATCH] qemu: add .exrc
  2012-07-19 15:11 ` Peter Maydell
@ 2012-07-19 15:24   ` Michael S. Tsirkin
  2012-07-20 10:26     ` Stefan Hajnoczi
  0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2012-07-19 15:24 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Anthony Liguori

On Thu, Jul 19, 2012 at 04:11:21PM +0100, Peter Maydell wrote:
> On 19 July 2012 15:29, Michael S. Tsirkin <mst@redhat.com> wrote:
> > I've been using this to get correct indenting with vim
> > in qemu for a while, but it's a bit easier if we
> > put the settings in the central place.
> > Note that
> > 1. you still need to enable 'exrc' and 'secure'
> >    options in your vimrc for these settings to take effect.
> > 2. you can create a .vimrc file if 'exrc' is on but there's
> >    need to bypass this configuration.
> 
> I think editor configs could reasonably go on the wiki somewhere
> but I'm not sure they belong in our git repo...
> 
> -- PMM

kvm people need to work on both qemu and kernel which
have different styles, so switching styles manually gets old quickly.
The benefit is more people will send patches in the correct style.
What's the harm?

-- 
MST

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

* Re: [Qemu-devel] [PATCH] qemu: add .exrc
  2012-07-19 15:24   ` Michael S. Tsirkin
@ 2012-07-20 10:26     ` Stefan Hajnoczi
  2012-07-20 10:34       ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2012-07-20 10:26 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Peter Maydell, qemu-devel, Anthony Liguori

On Thu, Jul 19, 2012 at 4:24 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Thu, Jul 19, 2012 at 04:11:21PM +0100, Peter Maydell wrote:
>> On 19 July 2012 15:29, Michael S. Tsirkin <mst@redhat.com> wrote:
>> > I've been using this to get correct indenting with vim
>> > in qemu for a while, but it's a bit easier if we
>> > put the settings in the central place.
>> > Note that
>> > 1. you still need to enable 'exrc' and 'secure'
>> >    options in your vimrc for these settings to take effect.
>> > 2. you can create a .vimrc file if 'exrc' is on but there's
>> >    need to bypass this configuration.
>>
>> I think editor configs could reasonably go on the wiki somewhere
>> but I'm not sure they belong in our git repo...
>>
>> -- PMM
>
> kvm people need to work on both qemu and kernel which
> have different styles, so switching styles manually gets old quickly.
> The benefit is more people will send patches in the correct style.
> What's the harm?

>From my .vimrc:

au BufNewFile,BufRead */qemu/*.c,*/qemu/*.h,*/qemu/*.hx,*/qemu/*tool
setlocal ts=4 sw=4 et

I agree that it's useful to have this, just like .gitignore or
.gdbinit.  It makes developer's lives easier and encourages consistent
coding style.

Stefan

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

* Re: [Qemu-devel] [PATCH] qemu: add .exrc
  2012-07-20 10:26     ` Stefan Hajnoczi
@ 2012-07-20 10:34       ` Peter Maydell
  2012-07-20 10:37         ` 陳韋任 (Wei-Ren Chen)
  2012-07-20 11:02         ` Michael S. Tsirkin
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Maydell @ 2012-07-20 10:34 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Anthony Liguori, Michael S. Tsirkin

On 20 July 2012 11:26, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> From my .vimrc:
>
> au BufNewFile,BufRead */qemu/*.c,*/qemu/*.h,*/qemu/*.hx,*/qemu/*tool
> setlocal ts=4 sw=4 et

Basically I think editor preferences are a local matter which
can reasonably differ between different developers, so they
shouldn't be in the git repo.

(a) haven't you just demonstrated that even vim users have
different preferred settings?
(b) where do we stop? emacs? bbedit? there are a lot of editors
out there...

In any case, 3 settings clearly don't encompass the whole of
QEMU's coding style. The relevant bit of my .emacs tweaks about
20 different settings...

-- PMM

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

* Re: [Qemu-devel] [PATCH] qemu: add .exrc
  2012-07-20 10:34       ` Peter Maydell
@ 2012-07-20 10:37         ` 陳韋任 (Wei-Ren Chen)
  2012-07-20 11:02         ` Michael S. Tsirkin
  1 sibling, 0 replies; 7+ messages in thread
From: 陳韋任 (Wei-Ren Chen) @ 2012-07-20 10:37 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Stefan Hajnoczi, qemu-devel, Anthony Liguori, Michael S. Tsirkin

> In any case, 3 settings clearly don't encompass the whole of
> QEMU's coding style. The relevant bit of my .emacs tweaks about
> 20 different settings...

  Just leave the coding style checking to checkpatch.pl, I think?

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

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

* Re: [Qemu-devel] [PATCH] qemu: add .exrc
  2012-07-20 10:34       ` Peter Maydell
  2012-07-20 10:37         ` 陳韋任 (Wei-Ren Chen)
@ 2012-07-20 11:02         ` Michael S. Tsirkin
  1 sibling, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2012-07-20 11:02 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Stefan Hajnoczi, qemu-devel, Anthony Liguori

On Fri, Jul 20, 2012 at 11:34:21AM +0100, Peter Maydell wrote:
> On 20 July 2012 11:26, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > From my .vimrc:
> >
> > au BufNewFile,BufRead */qemu/*.c,*/qemu/*.h,*/qemu/*.hx,*/qemu/*tool
> > setlocal ts=4 sw=4 et
> 
> Basically I think editor preferences are a local matter which
> can reasonably differ between different developers, so they
> shouldn't be in the git repo.

This is why I simply set the shiftwidth and set indenting by space.
Clearly no "can reasonably differ" applies here.

> (a) haven't you just demonstrated that even vim users have
> different preferred settings?

No, it's the same with the addition of tabstop=4, which *is*
a matter of taste (how many spaces you want shown if you edit
a file with tabs, like a makefile).

> (b) where do we stop? emacs? bbedit? there are a lot of editors
> out there...

If people ask for it we can consider. I doubt it will be a real problem.

> In any case, 3 settings clearly don't encompass the whole of
> QEMU's coding style.
> The relevant bit of my .emacs tweaks about
> 20 different settings...
> 
> -- PMM

If you don't use vim why do you even care about this patch?

-- 
MST

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

end of thread, other threads:[~2012-07-20 11:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 14:29 [Qemu-devel] [PATCH] qemu: add .exrc Michael S. Tsirkin
2012-07-19 15:11 ` Peter Maydell
2012-07-19 15:24   ` Michael S. Tsirkin
2012-07-20 10:26     ` Stefan Hajnoczi
2012-07-20 10:34       ` Peter Maydell
2012-07-20 10:37         ` 陳韋任 (Wei-Ren Chen)
2012-07-20 11:02         ` Michael S. Tsirkin

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.