On May 17, 9:58 am, "Edward K. Ream" <[email protected]> wrote:
> Here is excerpts from Steve's reply: And finally, for this recap of our previous conversation, here is my last private reply to Steve. I hope to continue this conversation here, rather than in private. QQQQQ >> Is it ok with you to post this conversation to the leo-editor group? > Sure. Thanks. I'll post this conversation soon on leo-editor: http://groups.google.com/group/leo-editor Imo, it would be be best to continue our discussion there, so that as many people as possible can see it and contribute to it. > Right now, standing on one foot, I'd imagine the main bridge > would be conversions Leo->VimOutliner and VimOutliner->Leo. That will be straightforward. I'll start the Leo->VimOutliner script today. I can do a Python version of VimOutliner->Leo also. Presumably you will want to translate it into vim's scripting language. > Plus possible support for some of the most common VimOutliner keystrokes, > although you already mentioned your disinterest in modal editing. This is just my personal preference. Do you know that Tom L has already done an interesting set of vim-like bindings for Leo? He uses Leo's @mode machinery to do that. Naturally, you are welcome to revise and extend Tom's work as you see fit. >> If clones are important to you, the big question is whether you will >> find a way to do without sentinels containing gnx's. > > Clones will be an important part of the new program -- we've been > trying unsuccessfully to add clones to VimOutliner for a decade. The > second clause of your preceding sentence went right over my head -- I > don't know what sentinels or gnx's are. Sentinels are comment lines (using the delims for whatever language is in effect). Within an external file (a file created by Leo) sentinel lines: - delimit outline structure. - represent Leo directives. - represent the beginning and end of Leo sections. gnx's (Global Node Indices) are unique, immutable strings that give nodes unique, immutable identify. Gnx's seem essential in order to do clones properly (so that links to clones are *truly* unbreakable). Here is an example of a gnx:: ekr.20111116103733.9817 The format of a gnx is:: user-id.timestamp.n user-id is typically the user's SCCS id, so such id's are unique to a single individual in a project. timestamp is in year-month-day-msec format. n is a disambiguating integer in case two nodes would otherwise have the same gnx. If you look at .leo file, you will see lots of gnx's. If you look at any external file, you will see lots of sentinel lines. Most sentinels contain gnx's. For example, here is the start of leoApp.py, one of Leo's core files. All lines starting with #@ are sentinel lines. Lines starting with #@@ represent Leo directives. Note that the first (shebang) line is created by Leo's @first directive, in the fourth line. # -*- coding: utf-8 -*- #@+leo-ver=5-thin #@+node:ekr.20031218072017.2608: * @file leoApp.py #@@first #@@language python #@@tabwidth -4 #@@pagewidth 60 #@+<< imports >> #@+node:ekr.20120219194520.10463: ** << imports >> (leoApp) import leo.core.leoGlobals as g import os import optparse import string import sys import traceback import zipfile if g.isPython3: import io StringIO = io.StringIO else: import cStringIO StringIO = cStringIO.StringIO #@-<< imports > [big snip] The format of Leo files has gone through several revisions. The result is provably the minimum number of sentinels required to represent Leo outline structure **in the external file itself** (rather than in the .leo file). Leo uses the emacs outliner convention to represent indentation level. For example:: #@+node:ekr.20120219194520.10463: ** << imports >> (leoApp) The ** indicate that the node is at the second level of the outline. Leo extends the emacs convention: *9* means that the node appears at node 9 in the outline. Everything following the ** part in a +node sentinel is the node's headline. Important: the actual indentation within the *external file* does **not** correspond to node indentation level in the *outline*. This is crucial: it allows Leo to represent Python code properly. For details, see Leo's tutorial: http://webpages.charter.net/edreamleo/intro.html#creating-external-files-from-outlines Finally, the format of .leo files is xml: http://webpages.charter.net/edreamleo/appendices.html#format-of-leo-files The format of external files is plain text interspersed with sentinel lines: http://webpages.charter.net/edreamleo/appendices.html#format-of-external-files QQQQQ OK Steve, I hope to hear from you here. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
