help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [External] : Re: Making new menu after Tools using keymap-set-after


From: Eli Zaretskii
Subject: Re: [External] : Re: Making new menu after Tools using keymap-set-after
Date: Wed, 19 Jul 2023 14:58:49 +0300

> From: Drew Adams <drew.adams@oracle.com>
> CC: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
> Date: Tue, 18 Jul 2023 20:42:18 +0000
> 
>       (keymap-set-after my-menu "<drink>"
>         '("Drink" . drink-command) 'eat)
> 
>  makes a binding for the fake function key <DRINK> and puts it right
>  after the binding for <EAT>.
> 
>  Here is how to insert an item called ‘Work’ in the ‘Signals’ menu
>  of Shell mode, after the item ‘break’:
> 
>       (keymap-set-after shell-mode-map "<menu-bar> <signals> <work>"
>         '("Work" . work-command) 'break)
> ___
> 
> This node of the manual comes after nodes that
> specify defining menus in general.
> ___
> 
> BTW, Eli, isn't `define-key' here a typo -
> shouldn't it be `keymap-set':
> 
>  When you insert a new item in an existing menu,
>  you probably want to put it in a particular
>  place among the menu’s existing items.  If you use
>  ‘define-key’ to add the item, it normally goes at
>   ^^^^^^^^^^
>  the front of the menu.  To put it elsewhere in the
>  menu, use ‘keymap-set-after’:

Not a typo, because all the descriptions of making menu items in
previous sections use define-key.  If someone wants to rewrite those
sections to use keymap-set, patches will be welcome.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]