I have a defcustom with :type variable,
and I would like to constrain the variable name to comply to a pattern.
How would I do that?
for instance let say I want the custom to only accept a variable name starting with some prefix.
I have a defcustom with :type variable,
and I would like to constrain the variable name to comply to a pattern.
How would I do that?
for instance let say I want the custom to only accept a variable name starting with some prefix.
Don't use type variable. Use type restricted-sexp.
The predicate checks for a symbolp that is boundp (i.e., a variable) and whose symbol-name is matched by your chosen prefix.
See the Elisp manual, node Composite Types.
sethandler is also called! Any idea why? – AdrieanKhisbe Sep 21 '17 at 21:11fboundp' in one place, instead ofboundp'. – Drew Sep 21 '17 at 23:11