[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: |
uzibalqa |
Subject: |
RE: [External] : Re: Making new menu after Tools using keymap-set-after |
Date: |
Tue, 18 Jul 2023 20:55:50 +0000 |
------- Original Message -------
On Wednesday, July 19th, 2023 at 8:42 AM, Drew Adams <drew.adams@oracle.com>
wrote:
> 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>.
The declaration is making things much more complicated because we were just
using a vector [menu-bar mcp-topm]. Now it is characters with angled brackets
such as "<menu-bar mcp-topm>" rather than conforming with previous
define-key-after way.
More torture.
>
> 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'.
- Re: Making new menu after Tools using keymap-set-after, (continued)
- Re: Making new menu after Tools using keymap-set-after, Eli Zaretskii, 2023/07/18
- Re: Making new menu after Tools using keymap-set-after, uzibalqa, 2023/07/18
- Re: Making new menu after Tools using keymap-set-after, Eli Zaretskii, 2023/07/18
- Re: Making new menu after Tools using keymap-set-after, uzibalqa, 2023/07/18
- Re: Making new menu after Tools using keymap-set-after, Eli Zaretskii, 2023/07/18
- Re: Making new menu after Tools using keymap-set-after, uzibalqa, 2023/07/18
- Re: Making new menu after Tools using keymap-set-after, Eli Zaretskii, 2023/07/18
- Re: Making new menu after Tools using keymap-set-after, uzibalqa, 2023/07/19
- Re: Making new menu after Tools using keymap-set-after, Robert Pluim, 2023/07/19
- RE: [External] : Re: Making new menu after Tools using keymap-set-after, Drew Adams, 2023/07/18
- RE: [External] : Re: Making new menu after Tools using keymap-set-after,
uzibalqa <=
- RE: [External] : Re: Making new menu after Tools using keymap-set-after, uzibalqa, 2023/07/18
- Re: [External] : Re: Making new menu after Tools using keymap-set-after, Eli Zaretskii, 2023/07/19
- Re: [External] : Re: Making new menu after Tools using keymap-set-after, Eli Zaretskii, 2023/07/19
- RE: [External] : Re: Making new menu after Tools using keymap-set-after, Drew Adams, 2023/07/19
- Re: Making new menu after Tools using keymap-set-after, uzibalqa, 2023/07/18
- Re: Making new menu after Tools using keymap-set-after, Eli Zaretskii, 2023/07/19