[Geany] coroutines under geanylua

Timothy Boronczyk tboronczyk at xxxxx
Tue Feb 16 15:00:50 UTC 2010


Enrico, I looked at the source briefly and it looks like
geany.launch() essentially wraps utils_spawn_async(), though it looks
like it's only designed to execute a  command-- not a Lua function
asynchronously.  It's fine, though.  Here's how I worked around it:

#! /usr/bin/env lua

-- main execution begins here
(function ()
  -- was called by the user as a Geany plugin
  if (arg == nil) then
    -- determine arguments to send according to user selection
    geany.launch(geany.script, argument1, argument2, ...
  end

  -- was called by the plugin as a shell script
  else
    -- construct cmd from incoming args
    cmd = ...

    oc.execute(cmd)
    os.execute([[zenity --display=:0.0 --info --text="Action complete."]])
end)()


-Tim


> I don't know at all but Geany provides utils_spawn_async() which
> executes a command asynchronous, i.e. Geany won't block during
> execution. Not sure whether it's available in the geanylua plugin but
> in case not, it probably could be added.
>
>
> Regards,
> Enrico



More information about the Users mailing list