Subject: Re: bug#74561: [PATCH] Allow limiting the size of *Completions*

From: Spencer Baugh <[email-masked]>
Date: Sun, 16 Feb 2025 16:35:21 +0000 (UTC)

Juri Linkov <[email-masked]> writes:
>>> In the process, I realized that this optimization doesn't help
>>> completions-format=vertical without a lot of effort, since that fills
>>> the entire first column before continuing to the second column.
>>
>> FWIW, maybe we should change this behavior so instead of filling
>> column-by-column we fill line-by-line.
>
> I think this is exactly how we should improve completion--insert-vertical.
> Instead of filling the first column before continuing to the second column
> the algorithm could be changed to:
>
> 1. partition the list of completions (e.g. by `seq-partition`)
>    into N groups corresponding to columns;
> 2. then take the first elements from each sublist
>    while laying them out line-by-line.

I can do this, but just to warn you, this will require essentiallya
complete rewrite of completion--insert-vertical.  So the patch is going
to become a lot larger.  I suggest we should land the optimization for
completion--insert-horizontal and completion--insert-one-column first,
since those require smaller changes.