1

How can I tell paredit-everywhere to use bindings from paredit, so I can :

  • Use paredit's keybinding without having to redeclare them

  • Keep paredit-everywhere shortcuts the same as paredit if I change a shortcut in paredit

paredit-everywhere.el and paredit use mode-map to define keys.

A better way of formulate my question could be "how to use some paredit mode-map keys in paredit-everywhere mode-map when mode is paredit-everywhere)

I came across this manual page and came up with this:

(when (package-installed-p 'paredit-everywhere)
  (require 'paredit-everywhere)
  (eval-after-load 'paredit-everywhere
    '(progn (set-keymap-parent paredit-everywhere-mode-map paredit-mode-map)
        (define-key paredit-everywhere-mode-map (kbd "(") nil)
        (define-key paredit-everywhere-mode-map (kbd ")") nil)
        (define-key paredit-everywhere-mode-map (kbd "[") nil)
        (define-key paredit-everywhere-mode-map (kbd "]") nil)))
  (add-hook 'prog-mode-hook 'paredit-everywhere-mode))

which works (but is kinda-hacky) it make the paredit-everywhere-mode-map parent's paredit-mode-map and set the parenthesis, bracet open,close to nil to avoid the extra space added by paredit.

Do not hesitate to share if you have a better solution thus

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.