Skip to content
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 keybinding to toggle between a keyword & a string #9225

Conversation

practicalli-johnny
Copy link
Contributor

The function clojure-toggle-keyword-string will convert a string to a keyword, or keyword to a string.

The keybinding is added under the Clojure refactor menu, in the "cycle/clean/convert" section.

SPC m r c k

As this is a clojure-mode function, it is defined in the clojure-mode refactoring keybinding section of packages.el.

There are no conflicting keybindings from the clj-refactor package that is also part of the Clojure layer.
https://github.com/clojure-emacs/clj-refactor.el/wiki

@practicalli-johnny
Copy link
Contributor Author

The description of the new keybinding in the README.org file extends the org-table width, so I included the whole "Refactoring" table as the change. Please let me know if this was not the correct thing to do and I will change the pull request.

Thanks.

@bmag
Copy link
Collaborator

bmag commented Jul 21, 2017

Since keywords start with :, have you considered rc: instead of rck? Seems a bit more mnemonic to me, but also a bit less convenient. Also fits well with the rc#, rc[, etc.

Changing the whole table as you did was indeed the correct thing.

@practicalli-johnny
Copy link
Contributor Author

@bmag a great point about using : instead of k. As other keybindings use the character then so should the keyword.

I will update this pull request and and change the keybinding to rc:

Thank you

The function `clojure-toggle-keyword-string` will convert a string to a keyword,
or keyword to a string.

The keybinding is added under the Clojure refactor menu, in the
"cycle/clean/convert" section.

`SPC m r c :`

As this is a `clojure-mode` function, it is defined in the clojure-mode
refactoring keybinding section of packages.el.
@practicalli-johnny practicalli-johnny force-pushed the clojure-layer-keybinding-toggle-keyword branch from d55ab29 to 193673e Compare July 21, 2017 10:40
@practicalli-johnny
Copy link
Contributor Author

Updated this pull request to use a new keybinding, SPC m r c :, based on feedback on this pull request.

This new keybinding replaces the SPC m r c k keybinding and is in line with the other keybindings within this section of the menu.

Thanks to @bmag for the feedback.

@bmag
Copy link
Collaborator

bmag commented Jul 21, 2017

Thank you 👍 Cherry-picked into develop, you can safely delete your branch.

@bmag bmag closed this Jul 21, 2017
@practicalli-johnny practicalli-johnny deleted the clojure-layer-keybinding-toggle-keyword branch April 1, 2020 13:54
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.

None yet

2 participants