-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Add default keybindings for rename-ns-alias and add-arity refactorings, and refactor clojure-unwind #538
Conversation
Uppercase bindings are both hard to press and a bit confusing for the end users, so I generally avoid them. Probably in this case we can fold a few of the |
Would you like that to be done in this PR? It sounds like quite a big breaking change and personally I prefer having separate commands for discoverability instead of using prefix args. Another option in this case could be |
That makes sense under a certain point - when you start running out of meaningful keybindings you know you have to start compacting things and group them together. I'm not saying to remove the existing command - I'm just saying to remove its dedicated keybinding. I think such commands are a classic use case for a prefix key as technically this is just an extension of the core behaviour. Changing the existing key is just as big of a breaking change as far as I'm concerned, so nothing really changes in the end.
Extra prefixes should be utilized only to group multiple related commands. E.g. - if we had more commands that operated on function definitions it would make sense to put them under some shared prefix. |
Numeric prefix arg unwinds N levels, and universal arg unwinds all. clojure-unwind-all command is left as an alias for calling clojure-unwind with universal argument.
Removed keybinding for clojure-unwind-all (use C-u universal arg with clojure-unwind instead)
Ok, I refactored |
The changes look great! Don't forget to update the changelog as well. |
Done, and added a couple of tests as well :) |
Lovely! Thank you! 🙇 |
I placed these suggested bindings under the clojure-refactor-map and added them to the menubar:
C-c C-r n r
->clojure-rename-ns-alias
C-c C-r a
->clojure-add-arity
The
a
keybinding was taken byclojure-unwind-all
which didn't made much sense, so I took the liberty of changing it toU
as a "stronger" version of the existingu -> clojure-unwind
binding.Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):
M-x checkdoc
and fixed any warnings in the code you've written.