I have some defcustom variables that are for keymaps. Is there a way to set the :type in a defcustom to indicate it should be a keymap?
Is the right way to do it like this?
:type '(restricted-sexp :match-alternatives keymapp) Almost right.
:match-alternatives needs to be a list of predicates:
:type '(restricted-sexp :match-alternatives (keymapp)) And consider maybe also allowing the value to be a keymap variable (depending on what you really want):
:type '(restricted-sexp :match-alternatives ((lambda (x) (or (keymapp x) ; Can be a keymap var. (and (symbolp x) (boundp x) (keymapp (symbol-value x)))))))