Eric Abrahamsen
2018-04-30 22:25:45 UTC
I'm having an oddly hard time finding out programatically all the custom
variables in a custom group (recursively), or which group a custom
variable belongs to. I would have thought the latter would be a symbol
property, but it isn't.
Obviously `customize-group' must be able to find out, but when I
followed the code, the trail went cold in the widget jungle. I simply
don't see how it gets the list of options to display.
Right now I'm doing this, which I guess works okay, but it seems a bit hacky:
(let (target-syms)
(mapatoms
(lambda (sym)
(when (and (custom-variable-p sym)
(string-match-p "^gnus-\\|^message-"
(symbol-name sym)))
(push sym target-syms))))
target-syms)
variables in a custom group (recursively), or which group a custom
variable belongs to. I would have thought the latter would be a symbol
property, but it isn't.
Obviously `customize-group' must be able to find out, but when I
followed the code, the trail went cold in the widget jungle. I simply
don't see how it gets the list of options to display.
Right now I'm doing this, which I guess works okay, but it seems a bit hacky:
(let (target-syms)
(mapatoms
(lambda (sym)
(when (and (custom-variable-p sym)
(string-match-p "^gnus-\\|^message-"
(symbol-name sym)))
(push sym target-syms))))
target-syms)