I see, so you basically have your own event loop :) That's exactly the kind of solution I was thinking about when starting to think about coding a vim clone from scratch. So I'll start with the first suggestion :) I think in normal mode you should redirect all unhandled keys to a null function. This prevents inserting unhandled printable characters in normal mode. Even better, redirecting all printable keys to a null function and pushing back the unhandled keys to unread-command-events, so that it's possible to leave some emacs-binding even in normal mode. what do you think? Alessandro 2009/7/1 Frank Fischer <[email protected]>
On Wed, Jul 01, 2009 at 08:15:21PM +0200, Alessandro Piras wrote:
Follow up: the most interesting thing about your approach is that you don't use emacs keymaps. Could you explain me how it works (a short summary is ok) ?
A simple keymap catching all events is installed (the keymap of the minor mode 'vim-key-mode'). When an event comes in the function vim:handle-key is called. This function does some housekeeping and calls the function vim:input-key which is the entry point for vim-mode's own keymap. If the event can't be handled by vim:input-key, it's pushed back to unread-command-events, the keymap of vim-key-mode is disabled and the event can be processed by Emacs as usual.
Btw, keymaps of vim-mode are very similar to emacs-keymaps but contain more meta-information. But the general structure is the same. Therefore, in theory all emacs-events could be handled by vim-mode-keymaps, not only keyboard-events.
I know, the documentation is poor at this time, I'll try to improve it soon :)
Bye, Frank
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list