And this fixes yet another problem: 'mark-first-parents' seems solid now.
'unmark' still needs work but I see no reason I can't fix it as well. I'll 
post
it here if I succeed.


@language python

def mark_first_parents():
    
    """mark the first parent of each node, moving up the tree
        to the top level. print the list of marked parents."""
    
    parent_lst = []
    p = c.p
    old_p = p
    if not p.isMarked():
        c.markHeadline(p)
    
    for parent in p.parents():
        if parent:
            c.selectPosition(parent)
            if not parent.isMarked():
                c.markHeadline(parent)
                parent_lst.append(parent.h)
    
    c.redraw()
    if parent_lst:
        g.es("marked: " + str(parent_lst))
        
    c.selectPosition(old_p)
        
mark_first_parents()

 

> tscv11
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
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