控制自定义选项的显示顺序?

时间:2014-04-14 14:39:12

标签: elisp

在我的主要模式中,我有一些使用defcustomdefface定义的选项。每个都分配到通过:group定义的相同defgroup

当我执行M-x customize-mode时,所有选项都会显示并正常运行。

但是,我不喜欢它们出现的订单。例如,我希望用户更有可能需要或想要更改自定义。

不幸的是,我无法弄清楚Emacs如何确定订单。例如,它似乎与.el文件中定义它们的顺序或其字符串或:tag的字母顺序相对应。也许我忽略了一些显而易见的事情,但它似乎是......"随机"?在阅读Elisp文档和在线搜索时,我还没有找到答案。

是否可以控制选项的显示顺序,如果可以,如何控制?

1 个答案:

答案 0 :(得分:1)

选项的顺序由 C-h自定义确定。*(sort \ | order)RET

custom-browse-order-groups
  User option: If non-nil, order group members within each
               customization group.
  Properties: standard-value custom-type custom-requests
              variable-documentation
custom-browse-sort-alphabetically
  User option: If non-nil, sort customization group alphabetically in
               `custom-browse'.
  Properties: variable-documentation custom-autoload custom-loads
              standard-value custom-type custom-requests
custom-buffer-order-groups
  User option: If non-nil, order group members within each
               customization group.
  Properties: standard-value custom-type custom-requests
              variable-documentation
custom-buffer-sort-alphabetically
  User option: Whether to sort customization groups alphabetically in
               Custom buffer.
  Properties: variable-documentation custom-autoload custom-loads
              standard-value custom-type custom-version
              custom-requests
custom-menu-order-groups
  User option: If non-nil, order group members within each
               customization group.
  Properties: standard-value custom-type custom-requests
              variable-documentation
custom-menu-sort-alphabetically
  User option: If non-nil, sort each customization group
               alphabetically in menus.
  Properties: variable-documentation custom-autoload custom-loads
              standard-value custom-type custom-requests

custom-sort-items实施。

即,它们可以按字母顺序排序,组可以放在第一位或最后一位。

如果您想添加自定义排序,则需要修改来源或使用advice