Subject: bug#73734: [PATCH] Fix tmm menu layout

From: Manuel Giraud <[email-masked]>
Date: Fri, 11 Oct 2024 09:48:44 +0200

martin rudalics <[email-masked]> writes:

>>> Here, how I justify the modification of `colwidth':
>>>
>>>        - I don't think we need the "(min 30)" part since, if the frame is
>>>          wide enough, we always get a colwidth of 30.
>>>
>>>        - I don't think "(window-width)" is what we need since, by
>>>          default, the *Completions* buffer will use the full frame width.
>>
>> Martin, is that guaranteed?
>
> I don't think so.  At least we should check whether the buffer window of
> the *Completions* buffer satisfies the 'window-full-width-p' predicate.
> But (window-width) which, as Manuel later remarks, returns the width of
> the selected window, does look like a bad choice here.  I'm not familiar
> with tmm.el but would
>
> (window-width (get-buffer-window "*Completions*"))
>
> be wrong here?

I've tried this and it seems that, at the time of calling this function,
the *Completions* buffer does not exist yet.  So (get-buffer-window
"*Completions*") returns nil and we still get the current window width.
-- 
Manuel Giraud