Elisp 控制自定义选项的显示顺序?
在我的主要模式中,我有一些使用Elisp 控制自定义选项的显示顺序?,elisp,Elisp,在我的主要模式中,我有一些使用defcustom和defface定义的选项。每个组都被分配给通过defgroup定义的相同:组 当我执行M-x自定义模式时,所有选项都会显示并正常工作 但是我不喜欢它们出现的顺序。例如,我想把用户更可能需要或想要更改的自定义设置放在首位 不幸的是,我无法理解Emacs是如何决定订单的。例如,它似乎不符合.el文件中定义它们的顺序,也不符合它们的文档字符串或:tags的字母排序。也许我忽略了一些显而易见的事情,但似乎。。。“随机”?在阅读Elisp文档和在线搜索时,
defcustom
和defface
定义的选项。每个组都被分配给通过defgroup
定义的相同:组
当我执行M-x自定义模式时
,所有选项都会显示并正常工作
但是我不喜欢它们出现的顺序。例如,我想把用户更可能需要或想要更改的自定义设置放在首位
不幸的是,我无法理解Emacs是如何决定订单的。例如,它似乎不符合.el
文件中定义它们的顺序,也不符合它们的文档字符串或:tag
s的字母排序。也许我忽略了一些显而易见的事情,但似乎。。。“随机”?在阅读Elisp文档和在线搜索时,我没有找到答案
是否可以控制选项的显示顺序,如果可以,如何控制?选项的顺序由C-h自定义决定。*(排序顺序)RET:
并通过自定义排序项实现
也就是说,它们可以按字母顺序排序,组可以放在第一位或最后一位
如果要添加自定义排序,则需要修改源或使用。因此,我认为您的意思是,选项的排序由所有自定义组共享,通常由用户指定。因此,如果我想为我的模式的定制组更改它,我需要defadvice
功能customizemode
并临时更改顺序。这(大致)正确吗?或多或少;您可能希望建议自定义排序项目
——但我建议修改源以接受用户排序功能,并向上游提交补丁。
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