mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
Bug 810: Add a few comments pointing to the bug.
This commit is contained in:
parent
677e5c7adc
commit
359b131c6b
@ -108,7 +108,7 @@ free_keybinding(struct keybinding *keybinding)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SCRIPTING
|
#ifdef CONFIG_SCRIPTING
|
||||||
/* TODO: unref function must be implemented. */
|
/* TODO: unref function must be implemented. This is part of bug 810. */
|
||||||
/* if (keybinding->event != EVENT_NONE)
|
/* if (keybinding->event != EVENT_NONE)
|
||||||
scripting_unref(keybinding->event); */
|
scripting_unref(keybinding->event); */
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,7 +60,8 @@ int register_event(unsigned char *name);
|
|||||||
|
|
||||||
/* This unregisters an event number @event, freeing the resources it
|
/* This unregisters an event number @event, freeing the resources it
|
||||||
* occupied, chain of associated hooks and unallocating the event id for
|
* occupied, chain of associated hooks and unallocating the event id for
|
||||||
* further recyclation. */
|
* further recyclation.
|
||||||
|
* Bug 810: unregister_event has not yet been implemented. */
|
||||||
int unregister_event(int event);
|
int unregister_event(int event);
|
||||||
|
|
||||||
int register_event_hook(int id, event_hook_T callback, int priority, void *data);
|
int register_event_hook(int id, event_hook_T callback, int priority, void *data);
|
||||||
|
@ -268,6 +268,7 @@ run_lua_func(va_list ap, void *data)
|
|||||||
return EVENT_HOOK_STATUS_NEXT;
|
return EVENT_HOOK_STATUS_NEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* bind_key (keymap, keystroke, function) */
|
||||||
static int
|
static int
|
||||||
l_bind_key(LS)
|
l_bind_key(LS)
|
||||||
{
|
{
|
||||||
@ -284,6 +285,16 @@ l_bind_key(LS)
|
|||||||
|
|
||||||
if (!init_string(&event_name)) goto lua_error;
|
if (!init_string(&event_name)) goto lua_error;
|
||||||
|
|
||||||
|
/* ELinks will need to call the Lua function when the user
|
||||||
|
* presses the key. However, ELinks cannot store a pointer
|
||||||
|
* to the function, because the C API of Lua does not provide
|
||||||
|
* one. Instead, ask the "reference system" of Lua to
|
||||||
|
* generate an integer key that ELinks can store.
|
||||||
|
*
|
||||||
|
* TODO: If l_bind_key() succeeds, then the function will
|
||||||
|
* never be removed from the reference system again, because
|
||||||
|
* the rest of ELinks does not tell this module if the
|
||||||
|
* keybinding is removed. This is part of bug 810. */
|
||||||
lua_pushvalue(S, 3);
|
lua_pushvalue(S, 3);
|
||||||
ref = luaL_ref(S, LUA_REGISTRYINDEX);
|
ref = luaL_ref(S, LUA_REGISTRYINDEX);
|
||||||
add_format_to_string(&event_name, "lua-run-func %i", ref);
|
add_format_to_string(&event_name, "lua-run-func %i", ref);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user