fix-pymode-tab-space.dpatch
Jörg Sommer
joerg at alea.gnuu.de
Wed Jan 10 16:02:29 CET 2007
Hello G.,
G. Milde schrieb am Wed 10. Jan, 12:36 (+0100):
> +private define py_whitespace(cnt)
> +{
> + if ( get_blocal_var("py_use_tab") )
> + loop (cnt / TAB) insert_char('\t');
>
> This assumes every use of py_whitespace uses a multiple of TAB.
> However there are cases (in continuation lines or multi-line literal
> strings) where this is not the case, e.g.
>
> + py_whitespace(level * Py_Indent_Level + (col - current_indent));
Oh.
> My suggestion would be:
>
> +private define py_whitespace(n)
> +{
> + if ( get_blocal_var("py_use_tab") )
> + whitespace(n);
> + else
> + insert_spaces(n);
> +}
I change it.
> The choice of py_use_tab is non-intuitive and undocumented.
It's a bug fix and not intended for other usage.
> + set_blocal_var(Py_Indent_Level == TAB, "py_use_tab");
>
> With this logic,
>
> if I want to use tabs, I need to:
>
> add a python_mode_hook to set TAB to Py_Indent_Level or make sure
Why your Py_Indent_Level is different from TAB if you want tabs?
> if I do not want to use tabs, I need to:
>
> make sure, that TAB_DEFAULT != Py_Indent_Level or add a
> python_mode_hook to set TAB to something different than Py_Indent_Level.
This is not the intention of the patch. It tries not to introduce a new
technology to define indention of Python files. The reporter of the bug
complained about intermixed indention types in a file where one type
(spaces or tabs) was used.
Bye, Jörg.
--
“Perl—the only language that looks the same
before and after RSA encryption.” (Keith Bostic)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-jed-devel/attachments/20070110/6898515b/attachment.pgp
More information about the Pkg-jed-devel
mailing list