I'm trying to use electric pair mode for backticks in markdown mode. The following code hasn't worked and throws and error whenever I type a backtick. How was it wrong?
(defvar markdown-electric-pairs '((?\` . ?\`)) "Electric pairs for markdown-mode.") (defun markdown-add-electric-pairs () (setq-local electric-pair-pairs (append electric-pair-pairs markdown-electric-pairs)) (setq-local electric-pair-text-pairs electric-pair-pairs)) (add-hook 'markdown-mode-hook (lambda () (pandoc-mode t) (markdown-add-electric-pairs))) The error is
Wrong type argument: commandp, electric-pair
electric-pair. Setdebug-on-errortotand show the backtrace, or show where you use functionelectric-pair. You're apparently trying to invoke it as a command. (Is there even a function namedelectric-pair?M-x electric-pair-mode? FWIW, that works for me (after I(require 'elec-pair), load the above file and turn onelectric-pair-modein the buffer).