On Mon, 03 Jun 2024 14:40:47 +0200 Arash Esbati wrote: > Hi all, > > I have a custom keybinding "s-ß" with my German keyboard, but the issue > I'm facing is also reproducible like this: > > • emacs -Q > • In scratch, eval: > > (progn > (setq debug-on-error t) > (electric-pair-mode 1) > (keymap-global-set "s-#" (lambda (arg) > "Insert ARG backslash(es)." > (interactive "*p") > (self-insert-command arg ?\\)))) > > • Now hit "s-#" and the debugger says (linebreaks added manually): > > Debugger entered--Lisp error: (wrong-type-argument characterp 8388643) > #f(compiled-function () #)() > electric-pair--with-syntax-1(nil #f(compiled-function () #)) > electric-pair-syntax-info(8388643) > electric-pair-post-self-insert-function() > self-insert-command(1 92) > #f(lambda (arg) [t] "Insert ARG backslash(es)." (interactive "*p") > (self-insert-command arg 92))(1) > funcall-interactively(#f(lambda (arg) [t] "Insert ARG backslash(es)." > (interactive "*p") (self-insert-command arg 92)) 1) > command-execute(#f(lambda (arg) [t] "Insert ARG backslash(es)." > (interactive "*p") (self-insert-command arg 92))) > > Running the exercise with (electric-pair-mode -1) doesn't throw an > error. If the pairing in electric-pair-mode should only be triggered by self-inserting characters (as the current code seems to require), then the attached patch appears to avoid the above problem. Steve Berman