aboutsummaryrefslogtreecommitdiff
path: root/modules/selection-framework.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-25 18:05:45 -0500
committerCraig Jennings <c@cjennings.net>2026-05-25 18:05:45 -0500
commit8e33a17f66a0ce6dd6e135bfe934c33329ab3aec (patch)
tree164a0ab5410aa2802a93f2679c86e013838bf79d /modules/selection-framework.el
parent07f03f535a6c392d14ffe138b6f90c0b19eb6c83 (diff)
downloaddotemacs-8e33a17f66a0ce6dd6e135bfe934c33329ab3aec.tar.gz
dotemacs-8e33a17f66a0ce6dd6e135bfe934c33329ab3aec.zip
perf(mousetrap): cache built keymaps per profile
mouse-trap--build-keymap ran on every major-mode hook and rebuilt the whole keymap (~8 prefixes by ~30 events) from scratch each time, so rapid mode-switching paid that cost over and over. I moved the build into mouse-trap--build-keymap-1 and cache its result in mouse-trap--keymap-cache, keyed on the profile name plus its allowed-categories list. The same profile reuses the cached keymap, and editing a profile's categories changes the key so it rebuilds. Sharing one keymap object across buffers is safe here: the map only binds disallowed events to ignore and is never mutated after it's built. Added mouse-trap--clear-keymap-cache to force a fresh build after editing profiles by hand.
Diffstat (limited to 'modules/selection-framework.el')
0 files changed, 0 insertions, 0 deletions