Subject: Re: bug#9730: 24.0.50; `M-o' should not be _invoked_ in `global-set-key'

From: Nicolas Richard <[email-masked]>
Date: Thu, 28 Apr 2016 15:01:33 +0200

Lars Ingebrigtsen <[email-masked]> writes:

> Stefan Monnier <[email-masked]> writes:
>
>>> What is...  the heirarKey menu?  :-)
>>
>> It's the "kind of menu" that gets displayed in the minibuffer when you
>> hit M-o.
>
> Where is that defined?  I tried looking for the code in question, but it
> seems to be happening outside the normal Emacs...  channels...

It's in facemenu.el

See (info "(elisp) Defining Menus")

Here's a simple example :

(global-set-key
 (kbd "s-s")
 (let ((keymap (make-sparse-keymap "Options are...")))
   (define-key keymap (kbd "s-d") (cons "Doctor" 'doctor))
   (define-key keymap (kbd "s-b") (cons "Butterfly power" 'butterfly))
   keymap))

-- 
Nicolas