On Mar 12, 9:32 am, "Edward K. Ream" <[email protected]> wrote:

After letting my subconscious stew a bit on my initial words, I think
some amendments are in order...

> Conclusion
>
> - Whitespace issues are surprisingly important in cooperative
> environments.  Nobody likes unexpected changes to files.  It creates
> the illusion of unreliability.

Still true, but I think we can finesse this problem so that most
people won't notice :-)

> - Cleaning files (making them Leo-clean) before using Leo in a sprint
> should cause little upset.  It's a will defined process, and checking
> the diffs should verify that nothing important has changed.

I don't want to bother the Zope people with Leo's problems.  It's not
good advertising.

> - In contrast, the write_strips_blank_lines option is of little use in
> a cooperative environment: it will cause unexpected diffs the first
> time an @auto file is written.  It's not exactly an evil option, but
> it will be off-putting in too many cases.

The more I consider the write_strips_blank_lines option, the less I
like it. This option doubles the number of use cases, and doubles the
number of test cases, without fully solving any problem.

Ville's words about having Leo "just work" apply here.  It's true that
we can't make Leo "just work" perfectly, but I'd like to ignore
that :-)

> - Imo, Leo must support the \-N convention for @auto files, and
> probably @shadow files as well.  This is the only way to keep people
> happy if they don't want to allow files to be Leo-cleaned.

The more I think about this problem, the more I think the simplest way
is simply to clean files automatically.  Automatic cleaning can not
create real problems for Python programs, and imposing a clean style
as the "price" of using Leo can hardly be called odious.  Note: no
cleaning will ever happen until somebody using Leo makes a "real"
change to the external file.

Asking "permission" to clean files simply wastes everyone's time. It
gives busybodies a chance to butt in, to no real purpose. I'd rather
ask for forgiveness later :-)

> In short, cleaning files is the simplest and best way...the \-N convention 
> looks unavoidable.

Something like the \-N convention is indeed unavoidable.  Consider a
triple-quoted string::

class foo:
    def bar():
        '''compute the set of all sets
that are not members of themselves'''
        pass

With the present convention we would represent the docstring as::

        '''compute the set of all sets
\-4that are not members of themselves'''

but using "relative" adjustments is not good, especially for the most
common case in which the actual offset is zero.

Instead, the convention should use absolute offsets for non-comment
lines::

 '''compute the set of all sets
\=0that are not members of themselves'''

For python underindented comments, the best solution, imo, is simply
to "clean" the indentation by indenting it as needed.

Conclusions

1. Asking for permission to make trivial changes wastes everyone's
time and will give Leo a bad name.  It seems better just to clean
files automatically: few will know and fewer will care.  The FAQ
should probably discuss these automatic changes.

2. The write_strips_blank_lines options serves no good purpose and
should be removed.

3.  Multi-line docstrings require an escape convention.  The
convention should specify an absolute, not a relative, offset.  This
will fix keep offsets stable when changing the indentation of a node.

Edward
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to