On Fri, Sep 2, 2011 at 7:21 AM, Edward K. Ream <[email protected]> wrote:

> Let's imagine a world without *external* clones.  There is a great
> divide:
>
> A.  External nodes have no identity.  Leo's external files become
> isomorphic (identical) to emacs org-mode files.
>
> B. External nodes continue to have identity (gnx's in node sentinels).

Well, nodes simply must have identity.  For example, when I clone a
node and move into a view tree I am, very clearly, saying that I am
interested in *this particular* node.  It would be fruitless to create
a breakable representation of the node when we have gnx.  End of
discussion.

However, we can (and should) do better job of reducing identity
conflicts (nodes with the same gnx's but different contents). Ville
mentioned something like this awhile back.  Here are my thoughts:

In any outline, the user should be able to specify one "master" clone
whose value will override others in case of node conflicts.  This can
be done easily by adopting the following resolution (precedence)
rules.  These rules affect only Leo's read logic, and so are benign
and reasonably easy to do.

Rule 1:  By default, clones defined in external files overrule clones
defined in .leo files.

The reasoning is that users are more likely to modify external files
than .leo files.

Rule 2:  Clones defined in files containing @all directives have lower
priority than clones defined in other external files.

The reasoning is that @all denotes a "catch all" file that is likely
to be subsidiary to other external files.  The user is hardly likely
to edit such external files.

Rule 3:  An external file whose root node contains @clone-masters
(say) will have highest priority.

This rule allows, for example, an html programmer, to define "master"
clones in a well-defined place.  In some cases, it might be best to
define clone masters in the .leo file, rather than in any external
file.

It would be simplest if at most one node in an outline contained a
@clone-masters directive, but it would be feasible to allow multiple
@clone-masters nodes provided that each clone was defined in at most
one @clone-masters node.

Ignoring these complications, I think these rules go a long way
towards clarifying what the user may intend.

Your comments please.

Edward

P.S.  Note:  just because *some* clones must be specified (as usual)
by identity, does not mean that we couldn't *also* let patterns define
clones.  That might make an interesting plugin: these patterns would
not change Leo's core in any way.

EKR

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to