Easiest way would probably be an @move-file button/command where you 
specified a new location for the file in a popup. The command would: update 
the header with the new location, save the file (essentially copying it), 
and remove the file at the original location. This would not strictly be a 
"move"

Leo mostly follows a push/pull model for files. Where saving "pushes" the 
file(s) to the file system and updating an @clean file "pulls" from the 
file system (and if necessary merges). The "active_path.py" plugin can 
extend the functionality of "pull" operations. I'm not sure if this was 
intentional or not, but it creates a bit of a disconnect from directly 
manipulating the file system itself like people would be used to doing in 
file manager.

On Wednesday, February 27, 2019 at 4:53:14 AM UTC-5, Josef wrote:
>
> Several years ago there was some discussion about Leo as a file manager.
> I often find myself moving files around, which have an associated node in 
> leo.
> With associated node I mean not only @file (@clean) nodes, but also @url 
> nodes and recently often nodes with file://path-to-filename nodes in it.
>
> Currently, when I want to move these files to a new location I first need 
> to open a file manager, locate the file(s), move them with the file manager 
> to a new location, then adjust the node in Leo to point to the same file 
> again. In another post I was wishing leo could find the new location 
> automatically (for example by storing and then finding the SHA1 hash of the 
> file, however momentarily I would already be happy with something much 
> simpler.
>
> There are a multitude of ways how a node can be moved around in Leo, so it 
> is probably not easy to cover them all.
>
> I found the enddrag2 event handler, which I could use to hook a file move 
> (or copy) into, but I would need to know if the CTRL or ALT keys were 
> pressed or not, since this modifies the move.
>
> Perhaps there is a more general way to hook into the system when a node 
> gets moved? I need to treat cases differently when the node gets copied (or 
> cloned).
>
> - Josef
>

-- 
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