SegundoBob,
> You give a correct implementation of vnode2allPositions().
[...]
> The implementation of vnode2allPositions() in leoCommand.py is seriously
flawed
[...]
> But vnode2allPositions() is not used by Leo-Editor core
But vnode2allPositions is used in the leo-editor by the method
c.cloneFindParents. The vnode2allPositions method has this in its doc
string:
"Not really all, just all for each of v's distinct immediate parents."
I'm guessing it does exactly what Edward wants it to because he uses the
clone-find-x commands all the time. The clone-find-all-parents command
helps you quickly see the context of other occurences of the clone. But
sometimes the volume of other clones is very high due to distant
ancestors themselves having clone instances. Seeing so many repeated
instances of similar tree structure often becomes too much noise.
So probably your quibble with vnode2allPositions is that it doesn't do
what you expect it to do based on the name?
For my initial 'show-clones' command (now called 'show-clone-parents') I
wanted the same "reduced noise" approach as clone-find-all-parents and so I
re-used the vnode2allPositions method. Then based on your feedback, I wrote
the show-clone-ancestors which shows all the paths to the clone. Two
different use cases and I thought the latter would fit your use case. Does
it?
> Here is a function that guarantees positions Y and Z display as different
UNL's
> by appending/prepending the child index for Y or Z (child index in
brackets) to
> the headline of X
[...]
Have you seen the with_index and with_count parameters for get_UNL?
def get_UNL(self, with_file=True, with_proto=False, with_index=True,
with_count=False):
"""
with_file=True - include path to Leo file
with_proto=False - include 'file://'
with_index - include ',x' at end where x is child index in parent
with_count - include ',x,y' at end where y zero based count of same
headlines
"""
I didn't take a close look at your code, but is it any different than just
using those options? I didn't include those options in my
show-clone-ancestors, but that is easy to change. I figured the important
part is that if you click on the same-looking links, it will still take you
to the distinct instances of that position
Brian
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/leo-editor/CAO5X8Cz1WCD_jc5AHHL7un5ZSurW%2BnUEhjSyMbbDDv8vPuk%2BoQ%40mail.gmail.com.