Subject: bug#34517: tmm menubar menu items have no effect on Android

From: Juri Linkov <[email-masked]>
Date: Wed, 27 Feb 2019 23:04:14 +0200

Stefan, please advise shouldn't selecting a completion from the
*Completions* buffer clear the minibuffer's content before
inserting the selected completion?

>>> > Touching the top menu items like “File” opens a file submenu nicely
>>> > in tmm's *Completions* buffer.
>>> >
>>> > But touching menu items in its submenu like “New Window on Right”
>>> > does nothing.
>>>
>>> I can reproduce this in the latest version 27 on GNU/Linux:
>>> clicking with the mouse on menu items from M-` (tmm-menubar)
>>> has the same effect, i.e. no effect.
>>
>> tmm-menubar is supposed to be for when there's no mouse at all, so why
>> do we expect a mouse click to do anything in that case?
>
> Smartphones translate screen touch events to click event, so this is
> the only way to use menus.  Also the help text of tmm menus says:
>
>   "Click on a completion to select it."
>
> But now I see that tmm relies on completing-read-default
> and inserts initial input that gets concatenated with
> an item selected by clicking in the *Completions* buffer.
>
> When initial input is deleted manually with e.g. <backspace>
> before clicking on a menu item, then tmm works correctly.
>
> So the bug is in completing-read-default and can be reproduced
> with a simpler test case:
>
> 0. emacs -Q
>
> 1. ‘C-h f TAB’ displays a list of completions
>
> 2. type a nonexistent function name, i.e. some random text
>    in the minibuffer, e.g. “blabla”
>
> 3. click on an existing valid completion in the *Completions* buffer,
>    e.g. on “append”
>
> 4. instead of getting the selected item “append”, it fails with:
>
>    user-error: Symbol’s function definition is void: appendblabla