On Thu, Jul 31, 2003 at 11:30:20PM +0200, [EMAIL PROTECTED] wrote:
> overloading the binding function that way is clearly ugly

Not necessarily if you think of them as functions that "patch"
the existing bindings...

> (not to mention creating key maps every time you switch vi mode).

I haven't tested it, but it might be quite trivial to implement vi-style
keymaps by adding a 'locked' attribute to submaps causing the grab to
not be released a key has been pressed. (Esc is hard-coded to kill any
grab.)

> ahm, there is one serious item, though, currently process_bindings()
> segfaults on an empty table.

\begin{sort-of-rant}
Not on a an empty table but a nil object? This is due to the undocumented
feature that some of Lua API's functions don't check types of objects on
the Lua stack and thus segfault on wrong kinds of objects (luaL_getn in
this particular case). I recently noticed this myself (tab-completion in
query_ssh cores if no hosts are defined as well) and complained of it on
the Lua list... it appears that the checks have been implemented but are
*for some reason beyond me disabled in the default build* just like 
primitive multithreading support is disabled in the default build. While
the language itself is wonderful, there seems to be a bit too much 
just-hack-patch-and-fork mentality in Lua's packaging. Sure the patching
suits use in proprietary software but not installation as a system-wide
library on a free OS.

The type checks would be only a few extra instructions in Lua's core but
it's a bit too much asked from users to compile a patched Lua just for 
Ion. So, I wrote inefficient and bloated wrappers to some of the functions
to check the types of objects on stack. The code should be in the latest 
CVS snapshot. 
\end{sort-of-rant}

-- 
Tuomo

Reply via email to