|
From: | Ryan Johnson |
Subject: | Improve input handling documentation (was Re: Best way to intercept terminal escape sequences?) |
Date: | Sat, 04 Sep 2010 21:05:30 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2 |
On Sat, 04 Sep 2010 15:01:28 +0200 stepnem wrote:
What format should the diagram take? I don't think I've ever seen ascii art, let alone an image, in the emacs docs...> It would be really nice to have, somewhere in the emacs docs, a diagram > showing what processing happens to keyboard input, starting from raw bytes and > UI events, and tracing them (or their translations) through coding systems, > input methods, command loop, various keymaps, etc. and showing where in that > process the different read-* functions intercept that data (and where the > various unread-*-events reinsert things). A similar diagram for reading and > writing files would probably also be useful.Sounds great indeed! [...]> Unfortunately, even after spending so long on this problem I don't think I > know enough to generate that diagram...But perhaps you could come up with some initial version that others could continue improving upon?
Meanwhile, here's what I have inferred, roughly, about input handling. Hopefully those familiar with emacs' guts can correct and improve it:
<-------- keyboard input keyboard-coding-system <-------- unread-input-method-events [Input Method (optional, printable ascii chars only)] <-------- unread-post-input-method-events ??? <-------- non-keyboard (e.g. mouse) events <-------- unread-command-events (and unread-command-char) --------> read-char, read-event input-decode-map key-translation-map [local-]function-key-map --------> read-keyassorted keymaps (global, local, minor mode, emulation, char/text properties, overriding)
--------> read-key-sequence ??? read-number, read-string, etc. (???)(I have no idea where read-passwd fits in this hierarchy, nor how the command loop lines up with things).
NOTE: the description of read-key and input-decode-map makes it sound like read-event comes before coding systems, but empirically this is not true.
Regards, Ryan
[Prev in Thread] | Current Thread | [Next in Thread] |