I have a leo file stored in 'D:/dev/.leo/Dev.leo'.When I open this file with Leo (on Windows 10), I get'@edit D:/dev/.leo/Dev.leo'
Thanks for your suggestion!But this is the only node. In its body text it contains hundreds of othe nodes wrapped in an xml file. So deleting that node would delete all the contents of this Leo file.
BTW: Is there a safe way to include "<<...>>" structs in source code in the body pane? How can Leo be prevented from looking for such structs in the body pane?
In the meantime I was able to repair the Leo file using an external editor.It contained some Erlang source files. The Erlang source code uses some data structures that look like Leo section references '<<...>>'. That caused some hiccups so that in the end Leo wasn't able to parse the Leo file correctly and put everything under one node. Basically, the repair was just removing the t nodes that contained Erlang code.
This is the Erlang test file:
Given is the Erlang file 'erlang_test.erl' that I import in a fresh Leo outline (first image, erlang_test1.png).Then I change the '@auto' directive to '@file' and try to save the outline.That results in an error (second image, erlang_test2.png).
On Mon, Sep 16, 2024 at 5:41 AM 'rengel' via leo-editor wrote:BTW: Is there a safe way to include "<<...>>" structs in source code in the body pane? How can Leo be prevented from looking for such structs in the body pane?<<...>> always means a section reference for @file nodes. There are no exceptions. This constraint is the only way of reading @file nodes reliably, so this constraint is a fundamental part of Leo.<<...>> may be just text in other kinds of @<file> trees. See Leo's reference for details.
An @edit file is always considered to be a text file, isn't it? So we're thinking that an @edit node was created when it should have been something else, right?
Looking at the test erlang file, I see that the "<< ... >> " syntax seems to be an essential part. I had at first thought they were symbols that had not been escaped by the XML ingesting code, but I see that was wrong. I wonder if the section delineator characters "<< .... >> " could be changed using a directive, much like the comment character can be changed. Perhaps that would not be too much of a code change?
So basically that means you can't reliably use Leo's @file nodes for Elixir adn Erlang source code?
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS24H1Vei-AgxJXNj23qV_ODYtPGGvxw1T9es32-k7wNWA%40mail.gmail.com.
On Sep 16, 2024, at 2:50 PM, Thomas Passin <tbp1...@gmail.com> wrote:
The section marker has to be at the very left of the current indentation level, doesn't it?
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/663c2b66-852c-4799-81b1-54faf73bb5cbn%40googlegroups.com.
Reproducing the error is a little tricky,so this is to clarify how the error can be reproduced.- My test file is at location "D:/Downloads/erlang_test.erl".- From there I import this file with "File->Import Files->Import Any File...".- In Leo I get a new node "Imported Files" with the subnode "@auto D:/Downloads/erlang_test.erl".- In the subnode, I change "@auto" to "@file".- Then I press Ctrl+S to save the outline.- This creates the "undefined section" error.If I recreate an "@file D:/Downloads/erlang_test2.erl"" node manually and copy and paste the Erlang code from the first node into the body of this node and then save the outline, the ERROR DOES NOT OCCUR.
So what is happening when "@auto" is changed to "@file"?
Sections & File data in @<file> kind Sentinels? @others? .leo file? Notes ------------ ---------- ----------- ------------ ----- @asis no no yes @auto no yes no 1, 2 @auto-xx no yes no 1, 2 @clean no yes yes @edit no no no @file yes yes no @nosent no yes yes
@section-delims [[[ ]]]
Interesting. I’ve been using <<sections>> for 12 years now and have never previously stumbled onto that limitation. I don’t see it documented, but at the same time I’ve never been good at searching Leo’s docs.
Confirmed! When using "@section-delims [[[ ]]]" the error disappears.Thank you!Is there a way and/or place to define this language-specific?