[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] `completing-read`: Add `group-function` support to completio

From: Daniel Mendler
Subject: Re: [PATCH] `completing-read`: Add `group-function` support to completion metadata (REVISED PATCH VERSION 5)
Date: Tue, 11 May 2021 09:51:45 +0200

On 5/10/21 10:47 PM, Juri Linkov wrote:
> Probably you meant to name it `completions-group-sort`
> since the name `completions-sort` is too ambiguous?

Yes, I meant to add a `completions-group-sort(-function)` customizable

I attached the updated patch set, where the last patch
"0005-minibuffer-completion-help-Add-group-sorting.patch" adds the
`completions-group-sort-function` variable. (The behavior is equivalent
to the previous patch set where the `group-function` has a generalized
action argument.)

> Then such an option could support any function to perform sorting,
> and when necessary the API user could let-bind it around
> the API call, e.g. in the case of the ucs-char-names:> ...
> This is just an example, I'm not sure if read-char-by-name-group-sort is
> really needed, but this example demonstrates that it's up to the user to
> define options more specific to the completion table.

Of course, a completion command can let-bind/override certain
dynamically bound variables which influence the behavior of the
completion UI. However there are two downsides to be noted:

1. By doing such an override the ability of the user to configure the
completion UI is subverted.
2. Since the variables are let-bound, they influence the behavior of
nested recursive completion sessions. It is better to override the
variables with `setq-local` in a `minibuffer-setup-hook`.


Attachment: 0001-completing-read-Add-group-function-to-completion-met.patch
Description: Text Data

Attachment: 0002-completion-insert-strings-Split-function-Full-group-.patch
Description: Text Data

Attachment: 0003-minibuffer-completion-help-Do-not-check-completions-.patch
Description: Text Data

Attachment: 0004-completion-insert-vertical-Separate-groups-completel.patch
Description: Text Data

Attachment: 0005-minibuffer-completion-help-Add-group-sorting.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]