Mailing List Archive

Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.1,2.2
>>>>> "Guido" == Guido van Rossum <guido@cnri.reston.va.us> writes:

Guido> Modified Files: mmapmodule.c Log Message: Hacked for Win32
Guido> by Mark Hammond. Reformatted for 8-space tabs and fitted
Guido> into 80-char lines by GvR.

Can we change the 8-space-tab rule for all new C code that goes in? I
know that we can't practically change existing code right now, but for
new C code, I propose we use no tab characters, and we use a 4-space
block indentation.

-Barry
RE: Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.1,2.2 [ In reply to ]
> Can we change the 8-space-tab rule for all new C code that goes in? I
> know that we can't practically change existing code right now, but for
> new C code, I propose we use no tab characters, and we use a 4-space
> block indentation.

Heretic!

+1, FWIW =)
RE: Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.1,2.2 [ In reply to ]
+1 for me too. It also brings all source files under the same
guidelines (rather than seperate ones for .py and .c)

Mark.
RE: Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.1,2.2 [ In reply to ]
>>>>> "DA" == David Ascher <DavidA@ActiveState.com> writes:

DA> Heretic!

DA> +1, FWIW =)

I hereby offer to so untabify and reformat any C code in the standard
distribution that Guido will approve of.

-Barry
RE: Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.1,2.2 [ In reply to ]
>>>>> "MH" == Mark Hammond <mhammond@skippinet.com.au> writes:

MH> +1 for me too. It also brings all source files under the same
MH> guidelines (rather than seperate ones for .py and .c)

BTW, I further propose that if Guido lets me reformat the C code, that
we freeze other checkins for the duration and I temporarily turn off
the python-checkins email. That is, unless you guys /want/ to be
bombarded with boatloads of useless diffs. :)

-Barry
Re: Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.1,2.2 [ In reply to ]
"Barry A. Warsaw" wrote:
>
> >>>>> "Guido" == Guido van Rossum <guido@cnri.reston.va.us> writes:
>
> Guido> Modified Files: mmapmodule.c Log Message: Hacked for Win32
> Guido> by Mark Hammond. Reformatted for 8-space tabs and fitted
> Guido> into 80-char lines by GvR.
>
> Can we change the 8-space-tab rule for all new C code that goes in? I
> know that we can't practically change existing code right now, but for
> new C code, I propose we use no tab characters, and we use a 4-space
> block indentation.

Why not just leave new code formatted as it is (except maybe
to bring the used TAB width to the standard 8 spaces used throughout
the Python C source code) ?

BTW, most of the new unicode stuff uses 4-space indents.
Unfortunately, it mixes whitespace and tabs since Emacs
c-mode doesn't do the python-mode magic yet (is there a
way to turn it on ?).

--
Marc-Andre Lemburg
______________________________________________________________________
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
Re: Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.1,2.2 [ In reply to ]
M.-A. Lemburg <mal@lemburg.com> wrote:
> Why not just leave new code formatted as it is (except maybe
> to bring the used TAB width to the standard 8 spaces used throughout
> the Python C source code) ?
>
> BTW, most of the new unicode stuff uses 4-space indents.
> Unfortunately, it mixes whitespace and tabs since Emacs
> c-mode doesn't do the python-mode magic yet (is there a
> way to turn it on ?).

http://www.jwz.org/doc/tabs-vs-spaces.html
contains some hints.

</F>
Re: Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.1,2.2 [ In reply to ]
Fredrik Lundh wrote:
>
> M.-A. Lemburg <mal@lemburg.com> wrote:
> > Why not just leave new code formatted as it is (except maybe
> > to bring the used TAB width to the standard 8 spaces used throughout
> > the Python C source code) ?
> >
> > BTW, most of the new unicode stuff uses 4-space indents.
> > Unfortunately, it mixes whitespace and tabs since Emacs
> > c-mode doesn't do the python-mode magic yet (is there a
> > way to turn it on ?).
>
> http://www.jwz.org/doc/tabs-vs-spaces.html
> contains some hints.

Ah, cool. Thanks :-)

--
Marc-Andre Lemburg
______________________________________________________________________
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
Re: Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.1,2.2 [ In reply to ]
> Can we change the 8-space-tab rule for all new C code that goes in? I
> know that we can't practically change existing code right now, but for
> new C code, I propose we use no tab characters, and we use a 4-space
> block indentation.

Actually, this one was formatted for 8-space indents but using 4-space
tabs, so in my editor it looked like 16-space indents!

Given that we don't want to change existing code, I'd prefer to stick
with 1-tab 8-space indents.

--Guido van Rossum (home page: http://www.python.org/~guido/)
Re: Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.1,2.2 [ In reply to ]
>>>>> "M" == M <mal@lemburg.com> writes:

M> BTW, most of the new unicode stuff uses 4-space indents.
M> Unfortunately, it mixes whitespace and tabs since Emacs
M> c-mode doesn't do the python-mode magic yet (is there a
M> way to turn it on ?).

(setq indent-tabs-mode nil)

I could add that to the "python" style. And to zap all your existing
tab characters:

C-M-h M-x untabify RET

-Barry