where are the a="xxx" in leo files?

75 views
Skip to first unread message

Robert Cholette

unread,
Sep 12, 2019, 9:52:07 PM9/12/19
to leo-e...@googlegroups.com

When I save a  leo file and go through the xml I see those attributes are being removed, but when I reopen those files the right nodes are marked, cloned, selected and so on... 

 I'v tried going through a changelog but history of leo on the website stops at 2015... nothing describing file format changes..

Thanks in advance for elucidating 

Matt Wilkie

unread,
Sep 13, 2019, 1:15:23 AM9/13/19
to leo-editor
Do you mean "userAttributes" a.k.a. "unknownAttributes"? https://leoeditor.com/customizing.html#ua-s-extensible-attribues-of-nodes

(Just guessing. I don't know anything about the leo file format.)

-matt

Edward K. Ream

unread,
Sep 13, 2019, 1:45:28 AM9/13/19
to leo-editor
On Thu, Sep 12, 2019 at 8:52 PM Robert Cholette <felix...@gmail.com> wrote:
When I save a  leo file and go through the xml I see those attributes are being removed, but when I reopen those files the right nodes are marker, cloned, selected and so on... 

Leo stores non-essential attributes in the ~/.leo/db folder.  To see these caches, launch Leo with --trace=cache.

Edward

Robert Cholette

unread,
Sep 13, 2019, 9:21:44 AM9/13/19
to leo-editor
Thanks for the answer: Of course my obvious reply to this would be "So if I send a leo file to my friend and tell him 'see that marked node?' he'll anwser back 'what marked node?'" 

Am I understanding this correctly? Clones are now deduced from having the same ID more than once, but marked node is untracable without the db cache, right?

Robert Cholette

unread,
Sep 13, 2019, 11:42:44 AM9/13/19
to leo-e...@googlegroups.com
Just to clarify: the only 'impact' is that we lose the 'currently selected node' upon opening, and 'marked node(s)' when sending a file to a friend? 
Right?

(note: I started looking into xml of leo files because of all the functions I call on nodes (isCloned, isMarked, and so on) the only one that did not work from leoBridge is "isSelected" as I'm trying to set the right selected node upon opening a leo file in the plugin i'm developing in vscode. is this the right function for that? or should i just compare each node to c.p to check if it's the currently selected node?)

thanks in advance for your replies you guys!
--
Félix


On Thursday, September 12, 2019 at 9:52:07 PM UTC-4, Robert Cholette wrote:

Edward K. Ream

unread,
Sep 13, 2019, 12:41:08 PM9/13/19
to leo-editor
On Fri, Sep 13, 2019 at 10:42 AM Robert Cholette <felix...@gmail.com> wrote:

Just to clarify: the only 'impact' is that we lose the 'currently selected node' upon opening, and 'marked node(s)' when sending a file to a friend? 

Yes.  As a workaround, you could clone nodes you want to show to a friend :-)

Edward

Edward K. Ream

unread,
Sep 13, 2019, 12:59:45 PM9/13/19
to leo-editor
On Fri, Sep 13, 2019 at 8:21 AM Robert Cholette <felix...@gmail.com> wrote:

Thanks for the answer: Of course my obvious reply to this would be "So if I send a leo file to my friend and tell him 'see that marked node?' he'll anwser back 'what marked node?'" 

Right.  Instead, tell him to see the cloned node in some top-level node.
Am I understanding this correctly? Clones are now deduced from having the same ID more than once,

That's the way they have already be "deduced".
but marked node is untracable without the db cache, right?

Correct. The workaround is to clone nodes of interest and put them in a node called something like, "Bob, take a look at these nodes".

It's dead easy to gather nodes of interest:

1. Mark all the nodes you want Bob to see.

2. Use the cffm command. This command
  - Creates a new top-level node.
  - Clones all marked nodes and puts the clones as children of the new node.
  - Unmarks all nodes.

3. Change the headline of the newly-created node to attract Bob's interest.

Clear?

Edward

Robert Cholette

unread,
Sep 13, 2019, 1:25:17 PM9/13/19
to leo-editor
Yes! thank you, its' clear.  :)
It makes sense : marked nodes, along with the currently selected node as the file was saved, are now a 'personal' thing only visible to oneself as they work on a project. makes sense.


On Thursday, September 12, 2019 at 9:52:07 PM UTC-4, Robert Cholette wrote:

Matt Wilkie

unread,
Sep 15, 2019, 5:05:38 PM9/15/19
to leo-editor
It makes sense : marked nodes, along with the currently selected node as the file was saved, are now a 'personal' thing only visible to oneself as they work on a project. makes sense.

There is also `@bool put-expansion-bits-in-leo-files = True` which saves the tree open/closed state. So you could close all branches except the one of interest before saving and sending to friend. It add's noise to source code diffs of .leo files but would be helpful in this scenario. Also see https://github.com/leo-editor/leo-editor/issues/1022 and https://github.com/leo-editor/leo-editor/issues/1023.

True (recommended):
    Write "E" attribute bits in <v> elements.
    Leo outlines will record the expansion state of all nodes.

False: (Good for files like unitTest.leo)
    Suppress "E" attribute bits in <v> elements.
    Only the ancestors of the presently selected node will
    be expanded when Leo opens an outline.
Reply all
Reply to author
Forward
0 new messages