On Mon, Feb 11, 2013 at 12:44 PM, Matt Wilkie <[email protected]> wrote:

>
> I thought I'd try my hand at writing a leo button/command/thing to rename
> an external file to match the current node headline. I'm stuck at getting
> the previous headline contents. How does one get to the undo history?  (and
> am I even going about this the right way?)
>

Interesting question.

I started my inquiry with c.frame.tree.onHeadChanged.  There I found a
reference to c.frame.tree.revertHeadline, set in the c.frame.tree.select
logic and *also* set by onHeadChanged.

So c.frame.tree.revertHeadline is initial contexts of the headline text.
This might be enough for you.

However, this assumes that changes to the headline are done in the usual
way, by the user, rather than a script.

Using the undo stack to discover the previous value of v.h, where v is p.v,
is going to be harder work, I think, and might not even work if the user is
in the middle of editing a headline.

HTH.  Please feel free to ask more questions.

Edward

-- 
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 http://groups.google.com/group/leo-editor?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to