Add a keybinding deprecation mechanism; deprecate REPL jack-in keys#3982
Open
bbatsov wants to merge 2 commits into
Open
Add a keybinding deprecation mechanism; deprecate REPL jack-in keys#3982bbatsov wants to merge 2 commits into
bbatsov wants to merge 2 commits into
Conversation
Emacs has `make-obsolete' for symbols but nothing for keybindings, so as CIDER starts regrouping its keymaps under prefixes we need a way to move bindings without breaking muscle memory overnight. `cider--define-deprecated-key' binds the old key to the real command but hints, once per session, at the replacement (silenceable via `cider-warn-on-deprecated-keybindings'). `cider-list-deprecated-keybindings' shows everything still pending removal.
`C-c M-j`/`M-J`/`M-c`/`M-C` in the REPL predate the shared `C-c C-x` start map and just duplicate it. Route them through the new deprecation mechanism so they keep working but nudge toward `C-c C-x j j` / `j s` / `c j` / `c s`.
7dcd7d5 to
0fb369a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First step of the keybinding reorganization (toward grouped prefixes and, eventually, transient menus). The groundwork everything else needs: a way to retire a keybinding gradually, since Emacs only has
make-obsoletefor symbols, not keys.cider--define-deprecated-keybinds the old key to the real command but, the first time you use it in a session, prints a one-time hint pointing at the replacement. Silence it withcider-warn-on-deprecated-keybindings, and see everything still pending removal withM-x cider-list-deprecated-keybindings.First use of it: the REPL-only
C-c M-j/M-J/M-c/M-Cjack-in/connect keys, which have long been superseded by the sharedC-c C-xstart map. They keep working, just with a nudge.No existing binding stops working in this PR - it's purely additive plus the four nudges.
eldev test)eldev lint)