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: Drew Adams
Subject: RE: [External] : Re: Making new menu after Tools using keymap-set-after
Date: Tue, 18 Jul 2023 20:42:18 +0000

Caveat: I'm not really following this thread in detail.

OP: I think (among other things perhaps) you are
looking for an example of using `keymap-set-after'.

If so, I see two examples where `keymap-set-after'
is presented, in (elisp) `Modifying Menus':
___

 Here is an example:

      (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’:

I expect that the contrast to be made there is
between `keymap-set' and `keymap-set-after',
not between `define-key' and `keymap-set-after'.


reply via email to

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