Subject: Re: bug#57372: no-toolkit menu popups do not respect emacs font configuration

From: Tomas Hlavaty <[email-masked]>
Date: Thu, 25 Aug 2022 00:59:22 +0200

On Wed 24 Aug 2022 at 22:28, Eli Zaretskii <[email-masked]> wrote:
>> >> TTY menus seem fine except the extra > in menu-bar overlaps the next
>> >> menu-bar item text.
>> >
>> > That's by design, btw.
>> 
>> Strange design.  Say I want to open the Edit menu.  I press F10 and
>> suddenly I cannot see the Edit menu anymore.
>
> ??? The drop-down menu also hides part of the window's text, doesn't
> it?  More generally, _something_ has to be hidden, because this is a
> text-mode terminal: the menu cannot move outside of the frame, where
> it wouldn't overlap any of the windows.

That is not the issue.
Why does the Edit menu dissappear?
Because there are three extra charactes drawn over it.
Say the menu-bar looks like this:
File Edit Options
Press F10 and it looks like this:
 File > t Options
Where is my Edit menu?
What should I do now?

> So why is it important that the Edit menu is hidden, but not that the
> whole text below the File menu is suddenly unreadable.

Because when I want to open the Edit menu, my attention is on the Edit
menu and not on some other stuff somewhere else.  After pressing F10,
the Edit menu I saw earlier disappears.  I expect to see the Edit menu
the whole time I am trying to navigate to it.

>> What about doing it differently?  For no-toolkit Emacs, it would be
>> enough for me if the menu simply opened a *Menu* buffer with the
>> relevant menu items.  All those issues would suddenly disappear.
>
> That already exists: use tmm-menubar.

Thank you for the pointer.
It looks like the thing that pops up on F10 when menu-bar-mode is nil.
iirc I haven't used it because I found it unuseable
but a solution like that could probably work for me.
I'll have to try it a bit more.

Is there a reason, why is tmm-menubar restricted to tty?
The choice seems hardcoded in menu-bar-open.
I had to do this:
(defun x-menu-bar-open (frame)
  (with-selected-frame (or frame (selected-frame))
    (tmm-menubar)))
in order to use tmm-menubar on no-toolkit Emacs.
It would be nicer, if the cond in menu-bar-open was replaced
with run-hook-with-args-until-success and a customizable
open-menu-bar-functions variable.