From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Feng Shu <tumashu@163.com>
Cc: Emacs Devel <emacs-devel@gnu.org>, Martin Rudalics <rudalics@gmx.at>
Subject: Re: Question about minibuffer and child frames (Posframe)
Date: Mon, 07 Oct 2024 06:28:56 +0200 [thread overview]
Message-ID: <m2frp8359z.fsf@gmail.com> (raw)
In-Reply-To: <87jzek200d.fsf@163.com> (Feng Shu's message of "Mon, 07 Oct 2024 09:08:02 +0800")
Feng Shu <tumashu@163.com> writes:
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
> Wow, this is a good feature.
Thanks :-).
And BTW, thanks for Posframe! As you can see I value it enough to go to
great lengths to get it :-).
>
> posframe do not handle focus in most situation, for it is too complicate
> to let focus work. posframe just *show* the content of a buffer.
>
> When enable vertico-posframe, we just let the content of minibuffer is
> showed in a posframe, but input handle is in parent frame, we lock the
> height of parent minibuffer window and vscroll minibuffer window to hide
> minibuffer content in below function.
>
>
> (defun vertico-posframe--handle-minibuffer-window ()
> "Handle minibuffer window."
> (let ((show-minibuffer-p (vertico-posframe--show-minibuffer-p))
> (minibuffer-window (active-minibuffer-window)))
> (setq-local max-mini-window-height 1)
> (window-resize minibuffer-window
> (- (window-pixel-height minibuffer-window))
> nil nil 'pixelwise)
> (set-window-vscroll minibuffer-window 100)
> (when show-minibuffer-p
> (set-window-vscroll minibuffer-window 0))))
Very interesting, I hadn't noticed that at all! That explains why the
minibuffer appears empty on GUI frames because set-window-vscroll has no
effect on ttys. When I added the vscroll, I thought it wouldn't be
needed on terminals because there are no partially visible lines or
images or anything like that. And adding it would be quite difficult I
think, so it's not an option.
>> On GUI, consult-buffer pops up a child frame, which has, AFAICT, a
>> minibuffer at the top. The cursor is in that minibuffer. The minibuffer
>
> the minibuffer showed in posframe is not real minibuffer :-)
Yeah, that was quite confusing for w while :-).
>> ih the parent frame looks inactive. There is no prompt or anything else.
>> That's how it should be.
>
> No, it's content is hide, but it active.
Got it. By setting vscroll.
>> With my new code on tty, the same child frame pops up, but this time the
>> child frame's minibuffer contains a prompt and what I type is displayed
>> there and so on, but it doesn't have a visible cursor. The parent
>
>
> in posframe, cursor just a space with face of cursor.
So Po Lu was remembering right!
Do you perhaps know where that is done? I can't find it.
Because it's definitely not working on ttys ATM. I mean the cursor in
the parent frame's minibuffer doesn't bother me too much. But I would
love it if something like a cursor appeared on the posframe.
>> frame's minibuffer this time contains the prompt and the cursor, too.
>
> Maybe the below hack is not work well in tty
>
> (set-window-vscroll minibuffer-window 100)
Yes, that's it. It's a no-op on terminals.
> In my opinion, hide minibuffer's content just hack way, I can not find a
> better way to hide minibuffer window's content.
Well, nobody could forsee that there would ever be child frames on tty
;-).
P.S.:
As an aside, because that might affect Posframe maybe in the future. I
also implemented borders around child frames now, but in a strange way,
with the 'undecorated' frame parameter. If a tty child frame is not
undecorated, a border is drawn around it, otherwise it isn't.
The reason for this strange way of doing things is that I quit in a rage
when trying to add the normal border handling for tty frames. Works for
me. Just mentioning it so that others can comment how terrible that is :-).
next prev parent reply other threads:[~2024-10-07 4:28 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 12:50 Question about minibuffer and child frames (Posframe) Gerd Möllmann
2024-10-02 13:39 ` Po Lu
2024-10-02 13:52 ` Gerd Möllmann
2024-10-02 14:56 ` martin rudalics
2024-10-02 15:47 ` Gerd Möllmann
2024-10-02 16:08 ` martin rudalics
2024-10-02 17:17 ` Gerd Möllmann
2024-10-02 17:34 ` martin rudalics
2024-10-02 18:48 ` Gerd Möllmann
2024-10-03 7:35 ` Gerd Möllmann
2024-10-03 8:26 ` martin rudalics
2024-10-03 9:07 ` Gerd Möllmann
2024-10-03 9:33 ` martin rudalics
2024-10-03 9:50 ` Gerd Möllmann
2024-10-03 13:12 ` martin rudalics
2024-10-03 14:03 ` Gerd Möllmann
2024-10-04 7:24 ` Gerd Möllmann
2024-10-04 8:10 ` martin rudalics
2024-10-04 9:16 ` Gerd Möllmann
2024-10-04 9:31 ` martin rudalics
2024-10-04 9:55 ` Gerd Möllmann
2024-10-05 8:31 ` Gerd Möllmann
2024-10-02 18:43 ` Eli Zaretskii
2024-10-02 18:56 ` Gerd Möllmann
2024-10-07 1:08 ` Feng Shu
2024-10-07 4:28 ` Gerd Möllmann [this message]
2024-10-07 6:43 ` Feng Shu
2024-10-07 8:00 ` Gerd Möllmann
2024-10-07 8:17 ` Feng Shu
2024-10-07 8:32 ` Gerd Möllmann
2024-10-07 10:03 ` Feng Shu
2024-10-07 10:46 ` Gerd Möllmann
2024-10-07 13:44 ` martin rudalics
2024-10-07 14:29 ` Gerd Möllmann
2024-10-07 21:45 ` Feng Shu
2024-10-08 4:19 ` Gerd Möllmann
2024-10-08 5:01 ` Gerd Möllmann
2024-10-08 5:42 ` Feng Shu
2024-10-08 6:31 ` Gerd Möllmann
2024-10-08 13:06 ` Gerd Möllmann
2024-10-07 8:35 ` martin rudalics
2024-10-07 8:46 ` Gerd Möllmann
2024-10-07 8:52 ` martin rudalics
2024-10-07 9:12 ` Gerd Möllmann
2024-10-07 10:11 ` Feng Shu
2024-10-07 10:36 ` Gerd Möllmann
2024-10-07 12:12 ` Feng Shu
2024-10-07 12:24 ` Gerd Möllmann
2024-10-07 13:44 ` martin rudalics
2024-10-07 14:24 ` Gerd Möllmann
2024-10-07 8:35 ` martin rudalics
2024-10-07 9:46 ` Feng Shu
2024-10-07 7:20 ` Feng Shu
2024-10-07 8:12 ` Gerd Möllmann
2024-10-11 8:03 ` Gerd Möllmann
2024-10-07 8:34 ` martin rudalics
2024-10-07 9:35 ` Feng Shu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2frp8359z.fsf@gmail.com \
--to=gerd.moellmann@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=rudalics@gmx.at \
--cc=tumashu@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.