Busy now, so terse answer:

You need to copy-paste this stuff and adapt it (or perhaps make it a function):

path, err = g.getPathFromDirectives(c,p)
    editor = g.guessExternalEditor()

    # def openwith_rclick_cb():
        #print "Editing", path, fname
        if not editor:
            return
        absp = g.os_path_finalize_join(path, fname)
        cmd = '%s "%s"' % (editor, absp)
        g.es('Edit: %s' % cmd)
        p = subprocess.Popen(cmd, shell=True)

Anything that looks like oversight on that plugin probably is.
Especially, it should not refer to @thin etc. directly but use
atAnyFile... or something.



On Wed, Dec 8, 2010 at 9:55 AM, Matt Wilkie <[email protected]> wrote:
>> contextmenu.py
>
> oops. you did say that in the previous paragraph. sorry.
>
> Looking at "refresh_rclick" in contextmenu.py I see @file is not
> mentioned while @thin is. Is that an oversight or by design?
>
> ---
>
> I can see that "openwith_rclick" and "editnode_rclick" are the
> functions that define the context menu items for edit-whole-file and
> edit-this-node respectively. And in openwith I see how to determine if
> the current node is @file, @thin, etc.  What my python-fu is not up to
> though, is understanding how to flip to openwith_rclick from inside
> editnote_rclick if the headline matches condition X.
>
> And I completely fail to understand how either of these are called
> from "def cm_external_editor_f() ", or vice versa. They don't appear
> to be related at all. Or are you referring to some other function with
> "do the check in the implementation for the
> cm-external-editor command"?
>
> I apologise if this is something really basic. I'm still a beginner
> when it comes to python.
>
> cheers,
>
> -matt
>
> --
> 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.
>
>



-- 
Ville M. Vainio @@ Forum Nokia

-- 
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