What's the level of a blank line?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

What's the level of a blank line?

Steve Litt
Hi all,

Specification question. If an outline contains a blank line, and you don't
treat blank lines as comments, at what level does the blank line exist?

One could say that the blank line should be judged by the number of initial
tabs it contains, but I think this is definitely the wrong answer, because a
blank line with 4 tabs looks the same as one with 1 tab or no tabs or a bunch
of spaces or nothing at all.

One could say a blank line is automatically the same level as the line before
it. That might be awkward, however, if the line before it is at a lower level
(less indentation) than the line after it.

Perhaps it should be 1 level lower (more indent) than the line above it. Doing
that would make it accurate when it separates a parent from its first child.
However, if one had 4 blank lines in a row, it would be wierd to have each
indent more than the last. Perhaps it should be one more indent than the last
nonblank line.

In my view, perhaps the most intuitive would be to make it the same level as
the next headline below it. However, that would take some fancy programming
in certain circumstances, especially if there are multiple blank lines.

I'm making the parser for Node.rb, and I'd like to actually have this
specified, unlike Node.pm and Node.py, where I just let the chips fall where
they may.

Thanks

SteveT

Steve Litt
Founder and acting president: GoLUG
http://www.golug.org
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: What's the level of a blank line?

Stefan Schmiedl
Steve Litt (07.12. 12:16):

> One could say that the blank line ...
> One could say a blank line ...
> Perhaps it should be ...
> However, if one had 4 blank lines ...
> In my view, perhaps the most intuitive ...
>

If it's *that* complicated/unclear, avoid the problem:
blank input lines shall not appear in the parsed node tree.

Who needs roundtripping for outlines, anyways?

s.
--
Stefan Schmiedl
+-------------------------------+----------------------------------------+
|Approximity GmbH               | EDV-Beratung Schmiedl                  |
|http://www.approximity.com     | Am Br´┐Żuweiher 4, 93499 Zandt, Germany  |
|mailto:[hidden email]  | Tel. (09944) 3068-98, Fax -97          |
+-------------------------------+----------------------------------------+
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: What's the level of a blank line?

Steve Litt
On Wednesday 07 December 2005 01:07 pm, Stefan Schmiedl wrote:

> Steve Litt (07.12. 12:16):
> > One could say that the blank line ...
> > One could say a blank line ...
> > Perhaps it should be ...
> > However, if one had 4 blank lines ...
> > In my view, perhaps the most intuitive ...
>
> If it's *that* complicated/unclear, avoid the problem:
> blank input lines shall not appear in the parsed node tree.
>
> Who needs roundtripping for outlines, anyways?

The default of Node.rb is to ignore blank lines, but in those cases where
people actually want to keep the blank lines, that default can be overridden.

Steve Litt
Founder and acting president: GoLUG
http://www.golug.org
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: What's the level of a blank line?

Stefan Schmiedl
Steve Litt (07.12. 13:28):

> On Wednesday 07 December 2005 01:07 pm, Stefan Schmiedl wrote:
> > Steve Litt (07.12. 12:16):
> > > One could say that the blank line ...
> > > One could say a blank line ...
> > > Perhaps it should be ...
> > > However, if one had 4 blank lines ...
> > > In my view, perhaps the most intuitive ...
> >
> > If it's *that* complicated/unclear, avoid the problem:
> > blank input lines shall not appear in the parsed node tree.
> >
> > Who needs roundtripping for outlines, anyways?
>
> The default of Node.rb is to ignore blank lines, but in those cases where
> people actually want to keep the blank lines, that default can be overridden.

In this case, I'm all for inserting a default text:
    - This line has been left blank intentionally -
      - This line has been left blank intentionally -
   - This line has been left blank intentionally -
        - This line has been left blank intentionally -

No more problems with invisible indentation and people
will stop doing it soon enough .-)

s.
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: What's the level of a blank line?

Steve Litt
On Wednesday 07 December 2005 02:11 pm, Stefan Schmiedl wrote:

> Steve Litt (07.12. 13:28):
> > On Wednesday 07 December 2005 01:07 pm, Stefan Schmiedl wrote:
> > > Steve Litt (07.12. 12:16):
> > > > One could say that the blank line ...
> > > > One could say a blank line ...
> > > > Perhaps it should be ...
> > > > However, if one had 4 blank lines ...
> > > > In my view, perhaps the most intuitive ...
> > >
> > > If it's *that* complicated/unclear, avoid the problem:
> > > blank input lines shall not appear in the parsed node tree.
> > >
> > > Who needs roundtripping for outlines, anyways?
> >
> > The default of Node.rb is to ignore blank lines, but in those cases where
> > people actually want to keep the blank lines, that default can be
> > overridden.
>
> In this case, I'm all for inserting a default text:
>     - This line has been left blank intentionally -
>       - This line has been left blank intentionally -
>    - This line has been left blank intentionally -
>         - This line has been left blank intentionally -
>
> No more problems with invisible indentation and people
> will stop doing it soon enough .-)

Hi Stefan,

Node.rb is such a generic tool that such replacement would be inappropriate in
the tool itself. HOWEVER, one could create a 3 line callback routine that,
when run through a Walker object on the tree in question, would do that, and
put the messages at the appropriate level so the rest of Node.rb's
functionality would continue to work.

I finally decided to put blank lines as children of the next nonblank. It
works reasonably well. The application programmer could change that level to
the level of the next item in the outline by running a reverse Walker on the
tree, but I didn't want to saddle the runtime with that operation unless the
application programmer specifically wants it.

SteveT

Steve Litt
Founder and acting president: GoLUG
http://www.golug.org
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: What's the level of a blank line?

Stefan Schmiedl
Steve Litt (07.12. 14:41):

> > In this case, I'm all for inserting a default text:
> >      - This line has been left blank intentionally -
>
> Node.rb is such a generic tool that such replacement would be
> inappropriate in the tool itself.

"Are you being funny?" - "Obviously not" (I, Robot)

> I finally decided to put blank lines as children of the next nonblank.

*next* nonblank? not *previous*?

s.
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: What's the level of a blank line?

Steve Litt
On Wednesday 07 December 2005 03:02 pm, Stefan Schmiedl wrote:

> Steve Litt (07.12. 14:41):
> > > In this case, I'm all for inserting a default text:
> > >      - This line has been left blank intentionally -
> >
> > Node.rb is such a generic tool that such replacement would be
> > inappropriate in the tool itself.
>
> "Are you being funny?" - "Obviously not" (I, Robot)
>
> > I finally decided to put blank lines as children of the next nonblank.
>
> *next* nonblank? not *previous*?

Ooops, I meant previous. Once the outline is in Node form, the application can
run a reverse Walker on it (once I've written the reverse walker :-) in order
to put it to the level of the next nonblank headline.

SteveT
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner