elisp 如何访问一个groups下的所有变量, defgroup,defcustom

(defgroup vetur
  nil
  "Customization options for vetur"
  :prefix "vetur-"
  :group 'lsp-vue)

(defcustom colorDecorators.enable
  t
  "Use color decorators in vue"
  :type 'boolean
  :group 'vetur)

例如这里定义了一个group vetur, 我想获取该group下所有的变量如何获取? 已经Google了,但是基本上都是说如何customize group的。

(defgroup sly-ui nil
  "Interaction with the Superior Lisp Environment."
  :prefix "sly-"
  :group 'sly)

(defcustom sly-truncate-lines t
  "Set `truncate-lines' in popup buffers.
This applies to buffers that present lines as rows of data, such as
debugger backtraces and apropos listings."
  :type 'boolean
  :group 'sly-ui)

(defcustom sly-kill-without-query-p nil
  "If non-nil, kill SLY processes without query when quitting Emacs.
This applies to the *inferior-lisp* buffer and the network connections."
  :type 'boolean
  :group 'sly-ui)

;;===========

(get 'sly-ui 'custom-group)
;; => ((sly-truncate-lines custom-variable) (sly-kill-without-query-p custom-variable))


看了下源碼研究出來的。

defcustom 用了 custom-declare-variable,后者用 custom-add-to-group 來加变量名到 Group,实貭是个 put,所以用 get 就能看 Group 下的 Custom 項。


Update 有現成的 function custom-group-members