@persistence (related to @auto-rst)

66 views
Skip to first unread message

Largo84

unread,
Feb 15, 2015, 8:07:50 PM2/15/15
to leo-e...@googlegroups.com
I just noticed an @persistence node in my .leo file that contains numerous @auto-rst nodes.

  1. I never noticed them before, so I don't know if this is something new (using the latest Git pull).
  2. This node contains child nodes of the form: @data:@auto-rst [filename.txt] and these nodes contain a line of the form gnx: largo84......(that's my user name)
  3. What purpose(es) do these serve? What's the implication if I delete them?
Curiouser and curiouser....
Rob............

Edward K. Ream

unread,
Feb 16, 2015, 5:03:15 AM2/16/15
to leo-editor
​​
On Sun, Feb 15, 2015 at 7:07 PM, Largo84 <Lar...@gmail.com> wrote:
I just noticed an @persistence node in my .leo file that contains numerous @auto-rst nodes.

​@persistence nodes were introduced in Leo 5.0.  But this feature is only mentioned in the release notes. This is a documentation fail.  It's now on the list of things to be explained.

When writing an @auto file, Leo stores data (akin to bookmarks) in a subtree of the @persistence node.  When re-reading the file, the data allow Leo to restore gnx info. You can enable and disable @persistence nodes with:

    @bool enable-persistence = True

The default seems reasonable *only* if this feature is properly documented, which I hope to do later today.

@persistence nodes are a much simpler version of a too-ambitious plan abandoned about two years ago. The Aha (due to a remark by Terry Brown) is that we can do a *fairly* good job of linking nodes to gnx's by using something like bookmarks. Yes, bookmarks can break, but not as often as one might think.

HTH.

Edward

P.S. leoPersistence.py implements the new feature.

pd.find_position_for_relative_unl links unls saved in the @persistence tree with just-imported nodes. Here is the docstring::
   
    Given a unl relative to root, return the node whose
    unl matches the longest suffix of the given unl.
 

P.P.S. The final version of this post makes it seem as though I remembered all of the above.  This is far from the truth.  I had to search leo-editor for @persistence.  Here are two of the links I found from July of last year:


Some wry exchanges between Kent and me:
https://groups.google.com/d/msg/leo-editor/83Ec5f60zoE/HiXsorogYmAJ

EKR

Edward K. Ream

unread,
Feb 16, 2015, 11:01:36 AM2/16/15
to leo-e...@googlegroups.com
On Monday, February 16, 2015 at 4:03:15 AM UTC-6, Edward K. Ream wrote:
​​
You can enable and disable @persistence nodes with:

    @bool enable-persistence = True

The mere existence of an @persistence node should suffice to enable this feature. Leo should never create this node automatically and changing it to, say, @@persistence should disable the feature.  These changes will ensure that the OP's surprise will not happen again.

These changes will happen before 5.1 b1.

Edward

Largo84

unread,
Feb 16, 2015, 11:46:51 AM2/16/15
to leo-e...@googlegroups.com
Just did a quick documentation search (on LeoEditor.com) for more information about gnx's and uA's. I found only a small reference in the Appendix to the debut of gnx's in 4.1, nothing more about how to make them useful. There's no mention at all about uA's. I don't even know what it's an acronym for, much less if there's any possible utility for me. Is there more info on these concepts somewhere else?

Rob..............

Edward K. Ream

unread,
Feb 16, 2015, 12:32:18 PM2/16/15
to leo-editor
On Mon, Feb 16, 2015 at 10:46 AM, Largo84 <Lar...@gmail.com> wrote:
Just did a quick documentation search (on LeoEditor.com) for more information about gnx's and uA's. I found only a small reference in the Appendix to the debut of gnx's in 4.1, nothing more about how to make them useful. There's no mention at all about uA's. I don't even know what it's an acronym for, much less if there's any possible utility for me. Is there more info on these concepts somewhere else?

These are probably discussed in Leo's scripting chapter, but I'll see if I can make them more visible.  Thanks for this.

Edward

Edward K. Ream

unread,
Feb 16, 2015, 12:34:33 PM2/16/15
to leo-editor
On Mon, Feb 16, 2015 at 10:01 AM, Edward K. Ream <edre...@gmail.com> wrote:
On Monday, February 16, 2015 at 4:03:15 AM UTC-6, Edward K. Ream wrote:
 
The mere existence of an @persistence node should suffice to enable this feature. Leo should never create this node automatically and changing it to, say, @@persistence should disable the feature.  These changes will ensure that the OP's surprise will not happen again.

​Done at rev 7e3ef54.  All tests pass.  Some unit tests had to be revised slightly.

Removed @bool enable-persistence from leoSettings.leo.  It no longer has any effect.

Edward

Edward K. Ream

unread,
Feb 16, 2015, 12:36:47 PM2/16/15
to leo-editor
On Mon, Feb 16, 2015 at 11:32 AM, Edward K. Ream <edre...@gmail.com> wrote:
On Mon, Feb 16, 2015 at 10:46 AM, Largo84 <Lar...@gmail.com> wrote:
Just did a quick documentation search (on LeoEditor.com) for more information about gnx's and uA's. I found only a small reference in the Appendix to the debut of gnx's in 4.1, nothing more about how to make them useful. There's no mention at all about uA's. I don't even know what it's an acronym for, much less if there's any possible utility for me. Is there more info on these concepts somewhere else?
These are probably discussed in Leo's scripting chapter
​.

​The place to search first is LeoDocs.leo.  You will find explanations of both gnx's and ua's there.  Feel free to ask more questions--they will help improve the docs.

EKR

gatesphere

unread,
Feb 16, 2015, 1:03:02 PM2/16/15
to leo-e...@googlegroups.com
On 2/16/2015 12:36 PM, Edward K. Ream wrote:
> ​The place to search first is LeoDocs.leo.
I feel like that line itself should be documented in big boldface type
on Leo's website.
-->Jake

Edward K. Ream

unread,
Feb 16, 2015, 3:15:10 PM2/16/15
to leo-editor
On Mon, Feb 16, 2015 at 11:34 AM, Edward K. Ream <edre...@gmail.com> wrote:
 
The mere existence of an @persistence node should suffice to enable this feature. Leo should never create this node automatically and changing it to, say, @@persistence should disable the feature.  These changes will ensure that the OP's surprise will not happen again.

​One more tweak, at rev ab3315a:

QQQ
Added @boo create-at-persistence-nodes-automatically (default False) and support for same.

Imo, this is the right balance for newbies and power users
QQQ

The default for this new setting will always be False, so the @persistence nodes will never be created without the user's knowledge.

However, power users might prefer that @persistence nodes *are* created when needed, and setting the new setting to True will make that so.

This is more in the spirit of GTD (getting the issue out of my mind) than anything else.  I would guess that very few people use @persistence nodes now, and probably few will be tempted to use such nodes when the start using the new @nosent.

Edward

Edward K. Ream

unread,
Feb 16, 2015, 3:15:49 PM2/16/15
to leo-editor

​I'll see what I can do.

Edward

gatesphere

unread,
Feb 16, 2015, 3:34:11 PM2/16/15
to leo-e...@googlegroups.com
On 2/16/2015 3:15 PM, Edward K. Ream wrote:

The default for this new setting will always be False, so the @persistence nodes will never be created without the user's knowledge.

However, power users might prefer that @persistence nodes *are* created when needed, and setting the new setting to True will make that so.

This is more in the spirit of GTD (getting the issue out of my mind) than anything else.  I would guess that very few people use @persistence nodes now, and probably few will be tempted to use such nodes when the start using the new @nosent.


+1.  @persistence nodes actually made me actively avoid using @auto, because I really don't like polluting my outline like that...  I'm strange though.
-->Jake

Matt Wilkie

unread,
Feb 18, 2015, 2:21:27 AM2/18/15
to leo-e...@googlegroups.com

​The place to search first is LeoDocs.leo.
 
I feel like that line itself should be documented in big boldface type on Leo's website.

...or that (a portion of) Leo's website should be a perfect replication of LeoDocs.leo. ;-)

-matt

Reply all
Reply to author
Forward
0 new messages