Synchronize @path nodes with folders.
If a node is named '@path path_to_folder', the content (file and folder
names) of the folder and the children of that node will synchronized
whenever the node's status-iconbox is double clicked.
For files not previously seen in a folder a new node will appear on top
of the children list (with a mark).
Folders appear in the list as /foldername/. If you double click on the
icon-box of the folder node, it will have children added to it based on
the contents of the folder on disk. These folders have the '@path'
directive as the first line of their body text.
When files are deleted from the folder and the list is updated by
double clicking the files will appear in the list as filename
(or /foldername/).
You can describe files and directories in the body of the nodes.
You can organize files and directories with organizer nodes, an
organizer node name cannot contain with '/'.
Files and folders can be created by entering a node with the required
name as its headline (must start and/or end with "/" for a folder) and
then double clicking on the node's status-iconbox.
@auto nodes can be set up for existing files by double
clicking on the node's status-iconbox. If you prefer @shadow or
something else use the "active_path_attype" setting, without the "@".
There are commands on the Plugins active_path submenu:
show path - show the current path
set absolute path - changes a node "/dirname/" to
"@path /absolute/path/to/dirname". purge vanished (recursive) - remove
entries update recursive - recursive load of directories, use with
caution on large file systems If you want to use an input other than
double clicking a node's status-iconbox set active_path_event to a
value like 'iconrclick1' or 'iconclick1'.
active_path is a rewrite of the at_directory plugin to use @path
directives (which influence @auto and other @file type directives), and
to handle sub-folders more automatically.
> Kent and others who might be looking for a file system integration
> approach, here's the about plugin text for the active_path.py plugin.
> Tk only at the moment, until leo-qt handles clicks on the tree.
Here's a related idea familiar from ILeo:
How about a "act-on-node" command?
This would be similar to alt-I (push-to-ipython), in that it would
invoke whatever operation is associated with the node. Currently, many
plugins hook to low-level stuff like "double click on tree icon" or
whatever, which is sort of annoying if you mostly use keyboard.
I'm emphatically not referring to the fact that plugins can create
commands that can be hooked on any key you want - I'm thinking of one
key to remember that did the "logical" thing depending on the node
that is activated. Possibly a plugin could also open its own special
menu from that.
@url nodes would be opened, active_paths would be expanded, @graphs
would be launched, insert-plugin-specific-stuff here.
One way to implement this is to use the same approach as ipython does
with TryNext exception - all the registered hooks are run, the hook
function takes a look at the node, and either handles it or raises
TryNext exception (which propagates the call to next hook).
Basic framework for this could be snatched directly from
IPython/hooks.py (CommandChainDispatcher, which is a command chain
dispatcher (duh) that runs the hooks in priority order).
--
Ville M. Vainio
http://tinyurl.com/vainio
> > - maintain path in headline text, probably relative, possibly
> > absolute
> > - this would ease manual conversion to @<filetype>
>
> The first version of the code did that. I found the long path off-
> putting. YMMV.
active_path.py hides paths (which I agree are distracting) by taking
advantage of the possibility of putting @path on the first line of the
body, but this assumes the outline's following the filesystem structure.
Cheers -Terry
I think this behaviour will surprise users.
ctrl-o means 'open a file' Leo doesn't open the file, it 'reads' it.
to 'open' is to connect to a file on the file system, to
'read' is to access the content of a file, very different operations.
I think ctrl-o should be changed to ctrl-r and the dialog named
'Read' instead of 'Open'
I think crtl-o should create an @auto node,
I say 'read' because in vim the command ':r(ead) <filename>' will
place the content of <filename> into the current buffer at the cursor position.
and ':e(dit) <filename>' creates a new buffer associated with <filename>
maybe ctrl-o should list .leo files, ctrl-e select from all, create @auto nodes,
ctrl-r place file contents into current node.
Too vimcentric? What are the emacs equivalents?
@edit ?
> I'm not sure what to call it. Maybe @view (as in the plugin) . Maybe
> @open?? I don't think @slurp will fly :-) Any suggestions?
To review, we are discussing:
- capability to register a node with an external file, allowing
editing the file from Leo, adding no sentinels to the external file.
- offer the option of parsing the external file into nodes which
reflect the structure of the content
- offer the option of not parsing the external file, it's entire content
is in the body of the @auto <filename> node
What if a button named 'Parse' would toggle the file
between 'all in one node' and 'reflect the structure of the file'