fix-pymode-tab-space.dpatch

G. Milde g.milde at web.de
Fri Jan 12 08:30:55 CET 2007


On 11.01.07, Jörg Sommer wrote:
> G. Milde schrieb am Thu 11. Jan, 12:31 (+0100):
> > On 10.01.07, Jörg Sommer wrote:
> > > > My suggestion would be:

> What do you think about

> private define py_whitespace(n)
> {
>    if ( get_blocal_var("py_use_tab") )
>    {
>        loop (n / TAB) insert_char('\t');
>        n -= n / TAB * TAB;
>    }
>    insert_spaces(n);
> }

This is OK, but IMO still harder to comprehend than

private define py_whitespace(n)
{
   if ( get_blocal_var("py_use_tab") )
     {
        $1 = USE_TABS;
        USE_TABS = 1;
        whitespace(n);
        USE_TABS = $1;
     }   
   else
     insert_spaces(n);
}


> > > > The choice of py_use_tab is non-intuitive and undocumented. 
> > 
> > > It's a bug fix and not intended for other usage.
> > 
> > Agreed. What I wanted to say is: the way the patched python_mode()
> > determines whether to use tabs or spaces for indentation (as stored in
> > py_use_tab) is non-intuitive and undocumented.

> I don't think it's non???intuitive, but right it's undocumented. I've added
> an explanation. Is this ok?

No. If you change the behaviour of upstream it must be documented in
README.Debian (and in the changelog, of course).

Also, you did not adress the new-introduced inconsistencies.

Anyway, why do you want to change the "default choosing logic"? Do you think
there are more people around that wish to use 8-spaces indention (and did
not bother about it until now) than people that use TAB_DEFAULT = 4 (and
will be hardly bitten by your change)?

Günter









More information about the Pkg-jed-devel mailing list