Dropping a file vs importing it: @edit vs @auto

31 views
Skip to first unread message

Thomas Passin

unread,
Apr 19, 2023, 10:04:46 AM4/19/23
to leo-editor
If there is a Leo shortcut on the desktop and you drag and drop a non-Leo file on it, an instance of Leo will start and contain an @edit node for the dropped file (a .cmd file will be put into an @file node).

If you import the same file, it will get imported into an @auto subtree.

Why the difference, and shouldn't both ways do the same thing?

Edward K. Ream

unread,
Apr 19, 2023, 10:43:49 AM4/19/23
to leo-e...@googlegroups.com
Heh. I didn't know that I could drag and drop as you describe. Here are some other ways of importing files:

-  The import-file command calls c.importAnyFile. This method contains various special cases. Maybe some of those cases are dubious.
- Create an empty @<file> node and do refresh-from-disk.
- Create an @button node to do exactly as you please with c.recursiveImport.

I don't think consistency between these ways is all that important.

Edward

Thomas Passin

unread,
Apr 19, 2023, 11:38:58 AM4/19/23
to leo-editor
Well, it's not *too* mysterious.  When you drop the file its path gets added to the command line that the OS uses to launch Leo (or whatever program the desktop icon is for).

jkn

unread,
Apr 19, 2023, 1:06:36 PM4/19/23
to leo-editor
I have been meaning to check this for ages - what happens if you try to drag and drop a .leo file into a running leo?

looks like you have to drop it into the tree pane, and it then becomes one of the open .leo files - cool

and if you try to drag and drop a non-leo file (into the tree pane) it gets turned into an @file node.

Good, I think...

    J^n

Thomas Passin

unread,
Apr 19, 2023, 1:48:17 PM4/19/23
to leo-editor
I do this from time to time.  It's a bit weird that it only works with the tree panel, but I guess that's not a problem.
Reply all
Reply to author
Forward
0 new messages