Subject: bug#78815: 31.0.50; completions truncated

From: Stephen Berman <[email-masked]>
Date: Wed, 18 Jun 2025 18:53:40 +0200

On Wed, 18 Jun 2025 19:18:24 +0300 Eli Zaretskii <[email-masked]> wrote:

>> From: Stephen Berman <[email-masked]>
>> Cc: [email-masked],  [email-masked]
>> Date: Wed, 18 Jun 2025 17:53:25 +0200
>> 
>> On Wed, 18 Jun 2025 18:43:02 +0300 Eli Zaretskii <[email-masked]> wrote:
>> 
>> >> From: Colin Baxter <[email-masked]>
>> >> Cc: [email-masked]
>> >> Date: Wed, 18 Jun 2025 15:16:40 +0100
>> >> 
>> >> >>>>> Eli Zaretskii <[email-masked]> writes:
>> >> 
>> >>     >> Date: Tue, 17 Jun 2025 11:01:58 +0100 From: Colin Baxter
>> >>     >> <[email-masked]>
>> >>     >> 
>> >>     >> 
>> >>     >> 1. emacs -Q <RET> 2. C-h f <RET> (for example) 3. completion
>> >>     >> <TAB> (for example) 4. Completion buffer opens with 131 possible
>> >>     >> completions 5. In foot of buffer is button that reads:
>> >>     >> [Completions truncated, click here to insert the rest.]
>> >> 
>> >>     > I don't see such a button, with today's master.
>> >> 
>> >> I've just git pulled and I'm afraid I still seen the button - screenshot
>> >> attached.
>> >
>> > What can I say? it doesn't work here, neither on MS-Windows nor on
>> > GNU/Linux, with this recipe:
>> >
>> >   emacs -Q
>> >   C-h f completion TAB TAB TAB TAB TAB
>> >
>> > (I have to type TAB 5 times before I see the end of the buffer, which
>> > has 135 lines and shows 131 completions.)
>> >
>> > Btw, it is strange that your screenshot shows the candidates which
>> > start from completion-auto-select (here the list starts with
>> > completion--cache-all-sorted-completions instead), and doesn't show
>> > the heading of the *Completions* buffer ("Click or type M-RET...").
>> >
>> > Did I use a wrong recipe or something?
>> 
>> I see the button with this recipe:
>> 
>> emacs -Q
>> C-h f completion TAB C-M-v
>
> OK, but that probably means the calculation of when to display the
> button is wrong, because it should appear as part of the first
> window-full, no?

I think the calculation is meant not to show the button in the available
space in the window, cf. this comment in `completion--insert-strings'
above the code that inserts the button:

;; If there's a bug which causes us to not insert the remaining
;; completions automatically, the user can at least press this button.

So the usual tabbing will scroll without showing the button, but if
something goes wrong, it should become visible.

So it seems that something is going wrong in the OP's case, but AFAICT
the recipes posted so far don't reveal the problem.

Steve Berman