Skip to content

Commit

Permalink
transient--show: Fix window height for more setups
Browse files Browse the repository at this point in the history
It is desirable to set `window-size-fixed' to t in the transient menu,
as we always used to do, until very recently.

We cannot do this when the transient window uses the full height of the
frame, the minibuffer may be used while the menu remains displayed, and
the height of the minibuffer has to be increased so that the completion
framework can display completion candidates.

If `transient-hide-during-minibuffer-read' is t [1], then that cannot
happen, so we fix the size in that case again.

[1] Which is the default, starting with the parent of this commit.

Re #532.
  • Loading branch information
tarsius committed Nov 20, 2024
1 parent 1d974b8 commit cdec3b6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ buffer became the current buffer, then that would change what is
at point. To that effect `inhibit-same-window' ensures that the
selected window is not used to show the transient buffer.
The use of a horizonal split to display the menu window can lead
to incompatibilities and is thus discouraged. Transient tries to
mitigate such issue but cannot proactively deal with all possible
configurations and combinations of third-party packages.
It may be possible to display the window in another frame, but
whether that works in practice depends on the window-manager.
If the window manager selects the new window (Emacs frame),
Expand Down Expand Up @@ -3740,7 +3745,14 @@ have a history of their own.")
(erase-buffer)
(when transient-force-fixed-pitch
(transient--force-fixed-pitch))
(setq window-size-fixed (if (window-full-height-p) 'width t))
(setq window-size-fixed
;; If necessary, make sure the height of the minibuffer
;; can be increased to display completion candidates.
;; See https://github.com/minad/vertico/issues/532.
(if (and (not transient-hide-during-minibuffer-read)
(window-full-height-p))
'width
t))
(when (bound-and-true-p tab-line-format)
(setq tab-line-format nil))
(setq header-line-format nil)
Expand Down

0 comments on commit cdec3b6

Please sign in to comment.