A series of patches for consideration. The first patch is purely aesthetic: it cleans up column headings (comments) and internal tabs in the shortcuts/key/mshortcuts tables in config.def.h. It also renames the fields in Key to match the nicer names given in config.def.h.
The second patch removes the mappedkeys[] optimization. I tested this by adding 1.000.000 additional entries to the end of key[]: static Key key[] = { ... #include "lots" /* * "lots" contains 999.999 repetitions of this entry, which is crafted * to hit all the tests in kmap() and fail the last: * { 'x', XK_ANY_MOD, "nope", .keypad=-1, .cursor=-1, .crlf=1 }, */ { 'x', XK_NO_MOD, "exit" }, }; While gcc goes from a few seconds to more than a minute to compile and link the above, I could not detect a performance regression in st. ;) The third patch simplifies the matching logic in kmap() and match() without changing the behavior. Hopefully, it is straightforward, but it probably deserves a careful reading to make sure I haven't made any mistakes. -Mark
0001-Fix-comments-and-tabs-for-mshortcuts-shortcuts-key-i.patch
Description: Binary data
0002-Eliminate-mappedkeys.patch
Description: Binary data
0003-Simplify-matching-logic-in-match-and-kmap.patch
Description: Binary data