On 21.02.2012 16:47, Anurag Priyam wrote: > On Mon, Feb 20, 2012 at 7:39 PM, Uli Schlachter <[email protected]> wrote: >> On 19.02.2012 14:56, Anurag Priyam wrote: >>> It feels silly to return true from the callback to keygrabber.run to >>> keep grabbing. > [....] >> Pointers? I would like to change it if possible. >> >> keygrabber.run() saves the given function in globalconf.keygrabber. This >> function is then called from event.c in event_handle_key(). This code also >> checks the return value from the function via lua_isboolean() and >> lua_toboolean() (event.c, line 519) and possibly calls keygrabber.stop(). > > Lua's C stack based API is not very intuitive (or maybe I haven't got > a hang of it yet). Hope I have got it right. The patch does seem to > work here.
I was going to complain that this breaks awful, however a closer look revealed that everything in there only ever does 'return true'. Still, how about a patch which removes some superfluous return statements and 'return true's from lua? :-) Will merge when I find the time (= not before friday). Uli -- - He made himself, me nothing, you nothing out of the dust - Er machte sich mir nichts, dir nichts aus dem Staub -- To unsubscribe, send mail to [email protected].
