Issues using import

51 views
Skip to first unread message

tfer

unread,
Feb 6, 2020, 5:15:43 PM2/6/20
to leo-editor
I'm still having issues with various import types:

  1. doing an import via the "File" menu is under the default @tabwidth -4, needs to be @tabwidth 2 for these files
    ** this has been the only successful import I have been able to make

  2. I placed the script Edward provided in a .leo document as an @button creates an "Imported files" node with children(s) @path nodes, one for the */js directory, with a child @path for the file */js/reveal.js .  No @auto node is created.
    - might be more useful for me if it created @clean nodes
    - useful that it is meant to be recursive in the target directory

  3. I've tired building my own sub-trees with an @tabwidth 2 in the body of one of an ancestor nodes of either an @auto or @clean node, saving the .leo document, (refusing the overwrite of the existing file so the .leo save takes place without clobbering those files). then closing and reopening the .leo document, expecting that opening to trigger the import of the file but nothing happens.
    -- is there a way to trigger this without closing and reopening?  I seem to remember you used to get a context menu to trigger this if you clicked a @thin node back in the day

Any hints from people that import then change the @<file> directive type?

Tom

tfer

unread,
Feb 6, 2020, 9:54:13 PM2/6/20
to leo-editor

 I'm thinking that this behavior:
  3. I've tired building my own sub-trees with an @tabwidth 2 in the body of one of an ancestor nodes of either an @auto or @clean node, saving the .leo document, (refusing the overwrite of the existing file so the .leo save takes place without clobbering those that thfiles). then closing and reopening the .leo document, expecting that opening to trigger the import of the file but nothing happens.

is due to taking a time stamp of the existing file even through I refused to accept the overwrite when saving the .leo file.  Therefore, the re-opening of the file doesn't  trigger a import, even though the node has no subtree.  I guess a non-modifying external edit would be a work around. 

Tom

Edward K. Ream

unread,
Feb 8, 2020, 4:53:30 AM2/8/20
to leo-editor
On Thu, Feb 6, 2020 at 4:15 PM 'tfer' via leo-editor <leo-e...@googlegroups.com> wrote:
I'm still having issues with various import types:

  1. doing an import via the "File" menu is under the default @tabwidth -4, needs to be @tabwidth 2 for these files
    ** this has been the only successful import I have been able to make

This is the hard way. After importing a file, either with the File:Import* commands or with the recursive import script, you should have an @auto, @file or @clean tree. After that, restarting Leo, or using <alt-x>refresh-from-disk will re-import the file.

After importing, @tabwidth will only affect new nodes.

If the contextmenu.py plugin is running, right-clicking a node will bring up a context menu. If that node is any kind of @<file> node, the context menu will have refresh-from-disk.

Edward

Edward K. Ream

unread,
Feb 8, 2020, 4:55:20 AM2/8/20
to leo-editor
On Thu, Feb 6, 2020 at 8:54 PM 'tfer' via leo-editor <leo-e...@googlegroups.com> wrote:

> is due to taking a time stamp of the existing file even through I refused to accept the overwrite when saving the .leo file.  Therefore, the re-opening of the file doesn't  trigger a import [snip]

As I implied in my last reply, you don't want to be continually doing imports. Get your file into an @file or @clean (or, if you must, @auto) and then your import troubles are over.

Edward

tfer

unread,
Mar 21, 2020, 11:22:30 AM3/21/20
to leo-editor


On Saturday, February 8, 2020 at 4:53:30 AM UTC-5, Edward K. Ream wrote:
On Thu, Feb 6, 2020 at 4:15 PM 'tfer' via leo-editor <leo-e...@googlegroups.com> wrote:
I'm still having issues with various import types:

  1. doing an import via the "File" menu is under the default @tabwidth -4, needs to be @tabwidth 2 for these files
    ** this has been the only successful import I have been able to make

This is the hard way. After importing a file, either with the File:Import* commands or with the recursive import script, you should have an @auto, @file or @clean tree. After that, restarting Leo, or using <alt-x>refresh-from-disk will re-import the file.

You are right, that was the hard way.  I don't use the minibuffer much, and the context menu didn't seem to have the "refresh from disk" - iitem, (maybe that was due to the impression of using a trackpad--or the "Import" item blinded me to this item further down, been away from Leo too long).

The new javascript should work for my purposes, though a diff against the original file and a @clean saved out version from the import had one extra blank line after a block of comments.

I've been sidetracked by Leo itself, working stuff to do with the package and testing, I'll report on that in another thread when I get further along.
Reply all
Reply to author
Forward
0 new messages