-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
evil-leader -> bind-map #3860
evil-leader -> bind-map #3860
Conversation
"C-S-j" nil | ||
"C-S-k" nil | ||
"C-S-l" nil | ||
"tH" nil ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rogue comment. :-)
Nice work. I don't see any show stoppers. The diff is predictably mostly dull reading. |
@TheBB fixed. thanks for going through it |
(define-key state-map | ||
(kbd dotspacemacs-major-mode-emacs-leader-key) major-mode-map)) | ||
(define-key state-map (kbd dotspacemacs-emacs-leader-key) root-map))))) | ||
(defalias 'spacemacs/set-keys-for-mode 'spacemacs/set-keys-for-major-mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this alias ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like spacemacs/set-keys-for-major-mode
is used only once, consider defined directly the function with name spacemacs/set-keys-for-mode
(renamed accordingly if we change it, see above comments).
Excellent 💯 See my comments. |
Since this PR is huge we have to merge it as soon as possible, ideally we should try to address the review tomorrow so I can merge it during the evening. I'm going to work on the move of evilification stuff, so you'll be able to rebase on this. |
I finished to move evilified-state files. |
It was but I'm going to change it to be more explicit
I'm working on it now. Should be done soon A couple of things :
|
@justbur Instead on bringing back Edit: wording |
@StreakyCobra good idea, let's define our own transitional and minimalistic |
@syl20bnr @StreakyCobra it should be perfectly fine for the two packages to coexist. If people want to use evil-leader for some reason, we shouldn't prevent that. I'd say just issue a deprecation warning for a while and then remove support |
@justbur I said this because of the point 2) where you explained there could be problem between the two :-) If it's possible and easier to have both, let's go for this. The depreciation can still be advised. |
@justbur there won't be any leader key conflict bound to different sub-maps ? |
Since the evil-leader package is in core space and not user space I would go for an adapter to use only bind-map under the hood. |
The problem would be if we removed the configuration for evil-leader and people just use
Emacs deals with overlaying multiple active maps fine. It's a conflict if the same key sequence is bound to different commands (not prefixes) in different maps, emacs just uses the first one it finds so you have to know the priority rules for maps. The only issue that may crop up is that we would now be using maps with different priority than the ones that evil-leader uses. The only place this would be a problem I think is if some minor mode uses I went through and renamed everything and added docstrings as requested. We still need to update the doc files, but I don't have time to do that right now. |
But if we define a shim |
We could alias them for now
|
Set up to use bind-map instead of evil-leader for leader key functionality. Alias evil-leader funcs and remove package
Removes dependence on evil-leader centralizing control over the method of key binding in core-keybindings.el
Adds useful help functions like describe-keymap.
Specifically need to be concerned with modes that make their maps overriding. 1. dired 2. evil-magit
Ok they're aliased now. By the way evil-lisp-state has evil-leader as a dependency |
There are some merge conflicts now. Maybe you can address those? I would really like to have this merged today or tomorrow, before going on to the other PRs. |
@TheBB would you mind doing it then? I'm traveling for most of the day and
|
Okay, done. 👍 Everything works here except the minor mode function. I can use it and it sets the keys in the correct map, but they don't become available when the minor mode is activated. We can fix that later though, since it's not used anywhere at the moment. |
It won't work right away it requires a call to evil-normalize-keymaps which
|
Oh okay. That works but I see now they end up under the major mode keys. Anyway, we can deal with that later. |
What do you mean under the major mode keys?
|
Oh I see SPC m. Yes that's where I put them but that can easily be changed.
|
Thanks, this is now merged. Brace yourselves. :-) |
For this kind of big changes I would like to be able to merge it myself. In this particular case I would have not cherry-picked commits, I would have preferred to merge without fast-forward using the GitHub button to have a merge commit in the history for easy revert if needed. I still cannot review the now merged changes so I cannot comment anything for now. I hope to be able to do it this evening. |
All right 👍 |
Amazing job guys !! 💜 |
Obviously a large change and deserves scrutiny, but everthing is working fine for me. The benefits are
spacemacs/set-keys
andspacemacs/set-keys-for-mode
describe-keymap
can be used on each of the generated maps to easily inspect them, since they are all distinct and easily available.