On 5/8/21 8:24 AM, Daniel Mendler wrote: > On 5/7/21 7:55 PM, Daniel Mendler wrote: >> On 5/7/21 7:03 PM, Juri Linkov wrote: >>> I tried to remove `read-char-by-name-group`, but it has a feature >>> currently not supported by `group-function`: >>> >>> (defcustom read-char-by-name-group nil >>> "How to group characters for `read-char-by-name' completion. >>> When t, split characters to sections of Unicode blocks >>> sorted alphabetically." >>> ===================== >>> >>> It seems a new function is needed to sort groups, e.g. `group-sort-function`. > > 3. Use a single function with an action argument > 3.1 group-function : (action=title) -> string -> string > 3.2 group-function : (action=transform) -> string -> string > 3.3 group-function : (action=sort) -> list string -> list string I attached the current set of patches. The last patch "0005-group-function-Implement-generalized-action-argument.patch" implements the generalized action argument. The other patches (1-4) do not differ from the previously sent patches. I send them for completeness. Given the lastest patch, the `group-function` works as follows: (group-function 'title cand) --> returns group title (group-function 'transform cand) --> returns transformed candidate (group-function 'sort groups) --> returns sorted alist of groups The modification is quite minimal over the previous version with the boolean transform argument. For completion tables which only want to provide group titles, the group function definition is equally simple as before: (defun some-group-function (action arg) (if (eq action 'title) (get-title arg) arg)) Daniel