On Sun, 26 Jun 2016 03:14:26 -0700 (PDT)
Mike Hodson <[email protected]> wrote:

> Hi,
> 
> I've just started using Leo for its amazing outlining ability, to
> take notes, and such at first.  I do hope to use it to organize
> source code projects, but do have some uncertainties. 
> 
> I'm so-far understanding the differentiation between @file (with
> sentinels I believe, as there seems to have been naming changing of
> the actions of these nodes over the years between 2008 and today that
> I've read in search history of the archive) 
> But, do have a curious question with regard to this potential
> scenario.
> 
> I would like to be able to copy a single .leo file somewhere, and
> then have any related 'real files' (for lack of better term) be
> re-created out of content already contained within the .leo file be
> re-created upon import or something of this nature. 

Welcome to Leo Mike.

You're work flow is perhaps not one that has been thought about, but I
think it's possible.

You can't use @file, @edit, or @auto as your external file type,
because they store no info. in the Leo file.  But there are other
external file types you can use:

@clean will notice and incorporate changes in the local file made
externally to Leo, but if the change is that the external file has
disappeared, the version in the .leo file will be used(*).

Or there's @nosent, which is similar except it ignores changes in the
external file, and always uses the content in the .leo file.

Either could work, but I would say that @clean works, for your work
flow, more by luck than design, whereas @nosent probably matches your
workflow better in its design intent.  So if you don't need @clean's
ability to notice and incorporate external changes in the external
files, @nosent might be less likely to spring surprises.  By external
changes I mostly mean changes while Leo is not running, i.e. changes
detected when Leo loads the .leo file, because I think Leo will alert
you to changes in a file in the outline made while Leo is running,
regardless of external file type.

The (*) is that Leo won't write the changed files unless it thinks it
needs to, and it won't think it needs to if you don't edit each one in
the outline, or, seeing that would be a pain, run this three line
script:

for node in c.all_unique_nodes():
    node.setDirty()
c.save()

To run that, just paste it in a spare node in the outline, and hit
Ctrl-B with the node selected.  The script just makes Leo think that
every node (and so every external file) in the outline has been changed
and therefore needs saving, which it then does, creating any missing
external files.

Hope that helps.

Cheers -Terry

> Say I need to make 'real files' for a source project. but I want to
> simply ship the single leo file around without requiring an archiver
> that properly understands things like file permissions, long file
> names, capitalization, etc. Then, when Leo opens this file, it
> creates all the 'real files' again from the content it still then
> keeps within the leo file. Any save of the node, saves the
> corresponding 'real file'. Any editing of the 'real file' can be then
> reimported back into the leo file. Somehow. 
> 
> Is anything like this described above, available today? 
> 
> What is your optimal scenario for sharing a "project" that includes
> many files, without using some sort of good archiver (yes, tar is
> good; tar is also sticky and opaque for people with windows computers
> sometimes)?
> 
> My use-case is that I want to keep a single .leo file synchronized as
> I physically move around to different computers. I'm using
> Syncthing.  But, I don't want to have to rely on Syncthing to sync
> -trees- of files; just a single file, that then can repopulate a
> tree. 
> 
> I'm open to any suggestions you may have!
> 
> Mike

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to