Support for @edit now on trunk

2 views
Skip to first unread message

Edward K. Ream

unread,
Feb 25, 2009, 1:25:00 PM2/25/09
to leo-editor
Rev 1598 contains preliminary support for @edit nodes. These nodes
contain the entire content of a file.

Initially, Leo's File:Open command creates such nodes when opening any
non-.leo file.

When writing @edit nodes, Leo uses Leo's @auto write logic. That is,
no sentinels are written. It should be possible to (temporarily) put
child nodes in @edit trees, but it doesn't look like this is happening
yet. The idea is that Leo will "just work" even if one uses @edit in
a strange way.

When reading @edit nodes, Leo just puts then entire text of the file
into the node, along with @language or @nocolor directives as
appropriate. These added directives will not change the file when it
gets written because no sentinels are written.

A new unit test passes, after it initially highlighted several
problems.

All unit tests pass, but a bit more work is needed.

Please report any problem immediately.

Edward

Edward K. Ream

unread,
Feb 25, 2009, 1:31:48 PM2/25/09
to leo-editor


On Feb 25, 12:25 pm, "Edward K. Ream" <edream...@gmail.com> wrote:

> When writing @edit nodes, Leo uses Leo's @auto write logic.  That is,
> no sentinels are written.  It should be possible to (temporarily) put
> child nodes in @edit trees, but it doesn't look like this is happening
> yet.

I was mistaken. This does appear to work.

It doesn't look like @edit nodes are properly marked dirty when
descendant nodes become dirty. I'll fix this soon.

Edward

Edward K. Ream

unread,
Feb 25, 2009, 1:38:49 PM2/25/09
to leo-editor


On Feb 25, 12:31 pm, "Edward K. Ream" <edream...@gmail.com> wrote:

> It doesn't look like @edit nodes are properly marked dirty when
> descendant nodes become dirty.  I'll fix this soon.

Mistaken again. I think this is working.

Edward

Kent Tenney

unread,
Feb 25, 2009, 4:18:03 PM2/25/09
to leo-e...@googlegroups.com
Test sequence:

create the following node, utility/test.py is an existing file.

@edit utility/test.py

If I double click that node icon, I get the message:
"Create parent directories first"

If I now save the Leo file, the contents of utility/test.py are deleted.
If I close Leo, restore test.py and open Leo, the file contents are
loaded properly.

>
> Edward
>
>
> >
>

Edward K. Ream

unread,
Feb 25, 2009, 4:34:11 PM2/25/09
to leo-e...@googlegroups.com
On Wed, Feb 25, 2009 at 3:18 PM, Kent Tenney <kte...@gmail.com> wrote:


Test sequence:

create the following node, utility/test.py is an existing file.

@edit utility/test.py

If I double click that node icon, I get the message:
"Create parent directories first"

If I now save the Leo file, the contents of utility/test.py are deleted.

Thanks for this report.  I'll fix this immediately.

Edward

Edward K. Ream

unread,
Feb 25, 2009, 4:49:27 PM2/25/09
to leo-e...@googlegroups.com

Done at rev 1599 of the trunk.

Edward

TL

unread,
Feb 25, 2009, 8:35:54 PM2/25/09
to leo-editor
I couldn't find any documentation on the @edit directive in the Leo
Users Guide. Am I looking in the wrong place?

TL

Edward K. Ream

unread,
Feb 25, 2009, 9:27:59 PM2/25/09
to leo-e...@googlegroups.com
On Wed, Feb 25, 2009 at 7:35 PM, TL <t...@tltools.net> wrote:

I couldn't find any documentation on the @edit directive in the Leo
Users Guide.  Am I looking in the wrong place?

The description I gave earlier today is pre-writing for the docs.  They'll be put in Leo's Users Guide soon.

Edward

Reply all
Reply to author
Forward
0 new messages