The system message string in gptel's transient menu is truncated to the width of the selected window when the transient is called. This means the width is wrong if the window is part of a split and the transient menu is displayed in a full-frame side-window at the bottom. The opposite situation can also occur depending on the value of transient-display-buffer-action.
The string needs to be prepared before the transient window is created, so we need a way to predict the system message width that will be required.
Actually neither window-width nor frame-width are correct here, since the width of the transient window depends on the value of transient-display-buffer-action. For example, transient menus appear below the active window for me, which means they are only as wide as the window, not the frame:
The system message string in gptel's transient menu is truncated to the width of the selected window when the transient is called. This means the width is wrong if the window is part of a split and the transient menu is displayed in a full-frame side-window at the bottom. The opposite situation can also occur depending on the value of
transient-display-buffer-action
.The string needs to be prepared before the transient window is created, so we need a way to predict the system message width that will be required.
Actually neither
window-width
norframe-width
are correct here, since the width of the transient window depends on the value oftransient-display-buffer-action
. For example, transient menus appear below the active window for me, which means they are only as wide as the window, not the frame:So a better fix is needed.
Originally posted by @karthink in https://github.com/karthink/gptel/issues/301#issuecomment-2091238801