Skip to content

Add a keybinding deprecation mechanism; deprecate REPL jack-in keys#3982

Open
bbatsov wants to merge 2 commits into
masterfrom
deprecate-keybindings-infra
Open

Add a keybinding deprecation mechanism; deprecate REPL jack-in keys#3982
bbatsov wants to merge 2 commits into
masterfrom
deprecate-keybindings-infra

Conversation

@bbatsov

@bbatsov bbatsov commented Jun 20, 2026

Copy link
Copy Markdown
Member

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-obsolete for symbols, not keys.

cider--define-deprecated-key binds 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 with cider-warn-on-deprecated-keybindings, and see everything still pending removal with M-x cider-list-deprecated-keybindings.

First use of it: the REPL-only C-c M-j / M-J / M-c / M-C jack-in/connect keys, which have long been superseded by the shared C-c C-x start map. They keep working, just with a nudge.

No existing binding stops working in this PR - it's purely additive plus the four nudges.


  • The commits are consistent with our contribution guidelines
  • You've added tests to cover your change(s)
  • All tests are passing (eldev test)
  • All code passes the linter (eldev lint)
  • You've updated the changelog
  • You've updated the user manual

bbatsov added 2 commits June 20, 2026 16:26
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`.
@bbatsov bbatsov force-pushed the deprecate-keybindings-infra branch from 7dcd7d5 to 0fb369a Compare June 20, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant