1

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) 

1 Answer 1

0

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))))))) 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.