Setting arbitrary windows as frame's minibuffer

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting arbitrary windows as frame's minibuffer

Akio Burns
I would like to set an arbitrary window as the frame's minibuffer so that I may position the minibuffer adjacent to the focused window when it is invoked rather that at the bottom of the frame.

After removing the validation in frame.c

     if (!MINI_WINDOW_P (XWINDOW (val)))
       error ("The `minibuffer' parameter does not specify a valid minibuffer window");

I tried setting the frame's minibuffer with

    (set-frame-parameter (selected-frame) 'minibuffer (selected-window))

This works for the first minibuffer invocation. Unfortunately, once the minibuffer quits/closes Emacs becomes stuck trying to resize the window and the minibuffer visually migrates back to the bottom of the frame.

Given that minibuffer window can be placed in a separate frame, it seems to me this should not be difficult. Am I missing something simple that would permit arbitrary minibuffer positioning?

—Akio
Reply | Threaded
Open this post in threaded view
|

Re: Setting arbitrary windows as frame's minibuffer

martin rudalics
 > I would like to set an arbitrary window as the frame's minibuffer so
 > that I may position the minibuffer adjacent to the focused window
 > when it is invoked rather that at the bottom of the frame.

Here I'm doing that for a couple of months already.

 > After removing the validation in frame.c
 >
 >        if (!MINI_WINDOW_P (XWINDOW (val)))
 >          error ("The `minibuffer' parameter does not specify a valid minibuffer window");
 >
 > I tried setting the frame's minibuffer with
 >
 >      (set-frame-parameter (selected-frame) 'minibuffer (selected-window))
 >
 > This works for the first minibuffer invocation. Unfortunately, once
 > the minibuffer quits/closes Emacs becomes stuck trying to resize the
 > window and the minibuffer visually migrates back to the bottom of
 > the frame.

The behavior of non-separate minibuffer windows is hard-coded
in many places so this is no surprise.

 > Given that minibuffer window can be placed in a separate frame, it
 > seems to me this should not be difficult. Am I missing something
 > simple that would permit arbitrary minibuffer positioning?

Have a look at the patch attached to

http://lists.gnu.org/archive/html/bug-gnu-emacs/2018-08/msg00012.html

and you should have an overview of what you are missing.

martin