Eli Zaretskii writes: >> From: Alex >> Cc: 14793@debbugs.gnu.org, npostavs@users.sourceforge.net, regularclockwork@gmail.com >> Date: Mon, 02 Oct 2017 21:59:37 -0600 >> >> > I just asked that question because my reading of the code is that this >> > is not supported. Maybe I'm misreading: keyboard.c:read_char is not >> > for the faint at heart. >> >> Yeah, I'm having trouble going through it. Is there a way to make it >> supported, though? For example, what about catching the error around >> read_char_x_menu_prompt (keyboard.c:L2683) and not exiting if an error >> was thrown? > > That's hardly a clean solution. A clean solution would avoid calling > Fx_popup_menu when it detects the situation we are talking about. Right, I just figured it was the easiest way to check if the rest of the code supported prefix mouse clicks, but maybe it isn't for C. In any case, I have a possible solution below. >> >> Also, "(emacs) Mouse Buttons" states that "You can put more than one >> >> mouse button in a key sequence, but it isn’t usual to do so.". >> >> >> >> How would one do this if a mouse click can't be a prefix key? >> > >> > By making a menu, I presume. >> >> Do you mean those mentioned in "(emacs) Menu Mouse Clicks"? Does >> clicking in those menus count as key sequences? > > Yes, of course. You can see that with "C-h l", for example. Also, > every non-leaf menu item is a keymap. Ah, I see it now. It seems that it depends on the menu (the binding for C-down-mouse-1 isn't a keymap, but C-down-mouse-2's is, which is important for below). Anyway, I tried out the following diff, which is based on the condition at xmenu.c:L1460. The problem is that it uses the global variable `menu_items_used', which is incremented during the execution of Fx_popup_menu (keymap_panes). So the diff uses the value of `menu_items_used' of the previously called menu. With the diff, you can see that pressing C-down-mouse-2 right after startup leads to an undefined key message instead of opening a menu; after pressing C-down-mouse-1, though, pressing C-down-mouse-2 opens its menu properly.