smartparens icon indicating copy to clipboard operation
smartparens copied to clipboard

sp--set-base-key-bindings should reset keymap first before setting new key binds

Open Inc0n opened this issue 3 years ago • 0 comments

Expected behavior

sp--set-base-key-bindings should reset the keymap first before populating the new key binds.

Current Behavior

As of the implementation right now, it defines the new binds in the keymap, but the previous binds are still in place if not overriden.

Solution

~~A line like (setq smartparens-mode-map (make-sparse-keymap)) in sp--populate-keymap would implement this feature.~~ Perhaps instead unbinding all keys from previous bind (sp -> paredit, then unbind all from sp) would work.

Why this would be useful

This would be useful for new users (such as me) to play around with the difference between paredit and sp key binds.

  • smartparens version: 4.7.1
  • Active major-mode:
  • Emacs version (M-x emacs-version): 28
  • Spacemacs/Evil/Other starterkit (specify which)/Vanilla: Evil
  • OS: Mac

Inc0n avatar Apr 15 '22 11:04 Inc0n