emacscollective / emacs.g

The Emacs Collective
ISC License
88 stars 49 forks source link

use-package :bind with :map keyword does not work #5

Closed sooheon closed 8 years ago

sooheon commented 8 years ago

For some reason, using use-package in this manner does not work correctly. The compiler complain that the declared map doesn't exists, when it should precisely be waiting until that gets loaded to make the bindings. Any idea what's up?

sooheon commented 8 years ago

Does it have to do with the auto-compilation, maybe? I only get the error when emacs tries to load the .elc file, when I delete that use-package works as intended.

Warning (initialization): An error occurred while loading ‘/Users/sooheon/.emacs.d/init.elc’:

Symbol's value as variable is void: evil-insert-state-map
sooheon commented 8 years ago

Relevant issue: https://github.com/jwiegley/use-package/issues/332

tarsius commented 8 years ago

The problem seems to be that evil does something strange. I greped its source and could not find the place where the the variable evil-insert-state-map is declared. I found some define-key forms that add bindings to the value of that variable, but where the initial value, a keymap with no bindings, comes from I do not know.

A wild guess would be that you have to enable evil-mode before you can start customizing this and other keymaps. That might make it impossible to use use-packages :bind, but you can always use bind-keys directly.

sooheon commented 8 years ago

It's not just evil-mode. I can confirm it happens with lispy-mode-map and ivy-minibuffer-map, and probably all the others. You're right though, I can put the binding in the regular way.

tarsius commented 8 years ago

I don't think this has anything to do with borg. And if this isn't specific to evil, which certainly is special with regards to key bindings, then I have no idea what might be wrong.

sooheon commented 8 years ago

I think you're right, it's more appropriate to discuss in use-package. Thanks.

tarsius commented 7 years ago

He, later I ran into this issue myself https://github.com/jwiegley/use-package/issues/378. And I have a fix cooking in https://github.com/jwiegley/use-package/pull/419.