Skip to content

Drive helm-projectile-toggle from a remap table#202

Merged
bbatsov merged 1 commit into
masterfrom
refactor-toggle-table
Jul 1, 2026
Merged

Drive helm-projectile-toggle from a remap table#202
bbatsov merged 1 commit into
masterfrom
refactor-toggle-table

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 1, 2026

Copy link
Copy Markdown
Owner

helm-projectile-toggle kept two hand-maintained copies of ~20 define-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 single helm-projectile--command-remaps alist and loops over it in both directions. The switch-project other-window/other-frame bindings keep their where-is-internal compatibility 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.

  • The commits are consistent with our contribution guidelines
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog
  • You've updated the readme (no user-facing change)

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.
@bbatsov bbatsov merged commit 3e18a1e into master Jul 1, 2026
10 checks passed
@bbatsov bbatsov deleted the refactor-toggle-table branch July 1, 2026 17:42
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