Drive helm-projectile-toggle from a remap table#202
Merged
Conversation
The enable and disable branches each hand-maintained ~20 parallel `define-key ... [remap ...]` calls, so every new command meant editing two places in lockstep. Collect the straightforward remaps into a single `helm-projectile--command-remaps' alist and loop over it in both directions. The `switch-project' other-window/other-frame bindings keep their compatibility fallback and stay out of the table. No behavior change; the toggle tests now assert the full table installs and clears.
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.
helm-projectile-togglekept two hand-maintained copies of ~20define-key ... [remap ...]calls, one to install the Helm remaps and one to clear them, so adding a command meant editing both in lockstep. This collects the straightforward remaps into a singlehelm-projectile--command-remapsalist and loops over it in both directions. Theswitch-projectother-window/other-frame bindings keep theirwhere-is-internalcompatibility fallback and stay out of the table.Pure refactor, no behavior change. The toggle tests now assert every entry in the table is installed on enable and cleared on disable.
M-x checkdocwarnings