Closed minad closed 1 year ago
Sounds like exactly the sort of Elisp magic that use-package
was created to abstract!
It seems autoloading keymaps is also possible directly, see for example https://github.com/protesilaos/tmr/blob/46048fa826b3e7ffcf56c09949ac2f6d52ae5d6b/tmr.el#L607-L608
If the following configuration is used, the
projectile-command-map
is loaded lazily.Unfortunately this interacts badly with the
which-key
view, which showsp -> lambda
on the first key press ofC-x
. On the second keypress ofC-x
,which-key
showsp -> +prefix
.This can be worked around by using a different lazy loading scheme, as follows:
Then
which-key
showsp -> projectile-command-map-lazy
on the first key press ofC-x
. On the second keypress ofC-x
, it showsp -> +projectile-command-map
as if it wouldn't have been loaded lazily.This means the code which is being generated for
:bind-keymap
can be improved. I am reporting this for now as a reminder also to myself. If there is interest (@jwiegley), I can try to work on a patch foruse-package-bind-key.el
.Related issues:
EDIT: This issue also affects
describe-personal-keybindings
which shows#<keymap>
and#<lambda>
due to the lazy loading.