{"action":"created","issue":{"url":"https://api.github.com/repos/magit/magit/issues/1918","labels_url":"https://api.github.com/repos/magit/magit/issues/1918/labels{/name}","comments_url":"https://api.github.com/repos/magit/magit/issues/1918/comments","events_url":"https://api.github.com/repos/magit/magit/issues/1918/events","html_url":"https://github.com/magit/magit/issues/1918","id":91146896,"number":1918,"title":"make-keymap vs. make-sparse-keymap","user":{"login":"syl20bnr","id":1243537,"avatar_url":"https://avatars.githubusercontent.com/u/1243537?v=3","gravatar_id":"","url":"https://api.github.com/users/syl20bnr","html_url":"https://github.com/syl20bnr","followers_url":"https://api.github.com/users/syl20bnr/followers","following_url":"https://api.github.com/users/syl20bnr/following{/other_user}","gists_url":"https://api.github.com/users/syl20bnr/gists{/gist_id}","starred_url":"https://api.github.com/users/syl20bnr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syl20bnr/subscriptions","organizations_url":"https://api.github.com/users/syl20bnr/orgs","repos_url":"https://api.github.com/users/syl20bnr/repos","events_url":"https://api.github.com/users/syl20bnr/events{/privacy}","received_events_url":"https://api.github.com/users/syl20bnr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-06-26T04:11:24Z","updated_at":"2015-06-26T21:20:26Z","closed_at":null,"body":"I'm working on the support of magit 2.1 in Spacemacs and due to the high number of keymaps I added a new function to automatically adapt a keymap to evil (we call this `to evilify a map*`).\r\nGood news is that it works great with *almost* all the keymaps in magit 2.1. I'm hitting a wall with the parent keymap `magit-mode-map` because it seems that `map-keymap` does not play well with `make-keymap` and `map-keymap` cannot iterate through the events.\r\nIf I change `make-keymap` to `make-sparse-keymap` then it works.\r\n\r\nI have some questions regarding this:\r\n1) What's the differences between `make-keymap` and `make-sparse-keymap` (besides the data structure) ? Does magit needs these differences ?\r\n2) Do you have any advice to iterate trough the keymap defined with `make-keymap` ?\r\n3) Ultimately, is it possible to use `make-sparse-keymap` ?\r\n\r\n`*` *evilifying* a map is to introduce navigation, search and selection à la Vim. When an evilified key binding is shadowed then we move it according to the following rules (`k` -> `K`, `K` -> `C-k` and `C-k` ->  `C-S-k`). So an example in magit is `discard` is moved to `K` and `untrack` is moved to `C-k`, `log-popup` is moved to `L`, etc..."},"comment":{"url":"https://api.github.com/repos/magit/magit/issues/comments/115886303","html_url":"https://github.com/magit/magit/issues/1918#issuecomment-115886303","issue_url":"https://api.github.com/repos/magit/magit/issues/1918","id":115886303,"user":{"login":"tarsius","id":25046,"avatar_url":"https://avatars.githubusercontent.com/u/25046?v=3","gravatar_id":"","url":"https://api.github.com/users/tarsius","html_url":"https://github.com/tarsius","followers_url":"https://api.github.com/users/tarsius/followers","following_url":"https://api.github.com/users/tarsius/following{/other_user}","gists_url":"https://api.github.com/users/tarsius/gists{/gist_id}","starred_url":"https://api.github.com/users/tarsius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarsius/subscriptions","organizations_url":"https://api.github.com/users/tarsius/orgs","repos_url":"https://api.github.com/users/tarsius/repos","events_url":"https://api.github.com/users/tarsius/events{/privacy}","received_events_url":"https://api.github.com/users/tarsius/received_events","type":"User","site_admin":false},"created_at":"2015-06-26T21:20:26Z","updated_at":"2015-06-26T21:20:26Z","body":"I think that functions that \"automatically fix keymaps\", such as `evilify` and `spacemacs/evilify-map` have to be able to deal with full keymaps (as created by `make-keymap`).\r\n\r\nI might use `make-sparse-keymap` for `magit-mode-map` but lean toward not doing it. This shouldn't be a big deal for you, just do it manually for this particular map. But sooner or later you will run into other full keymaps. My `keymap-utils.el` library could serve as inspiration when implementing keymap related features that are missing from Emacs itself."}}