[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Commands with more than one keybinding in menus
From: |
Stefan Monnier |
Subject: |
Re: Commands with more than one keybinding in menus |
Date: |
Wed, 14 Aug 2013 12:23:12 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> The macro was offered by a user of outshine, I only fiddled around with
> it until it worked without errors. It serves its purpose, because
> without it a minor-mode, unconditionally defining 'M-[S-]<arrow-key>'
> bindings, runs a high risk of breaking major-mode or user settings - I
> would not want to do without it.
There are a few ways to have your cake and eat it too:
- Move the conditional test into the command, so the menu entries are
bound to the same command as the keys. If you want the menu-entries
to skip the test, then you can do that by checking the event(s) that
triggered the command.
- You can use ":keys STRING" in the menu. This will show "STRING" as
the shortcut without checking if it indeed runs the same command.
- You can use dynamic key-bindings, i.e. instead of binding your key to
(lambda () (interactive) (if foo (CMD))), bind it to
(menu-item "" CMD :filter (lambda (cmd) (if foo cmd))).
Stefan
- Commands with more than one keybinding in menus, Thorsten Jolitz, 2013/08/13
- Re: Commands with more than one keybinding in menus, Stefan Monnier, 2013/08/13
- Re: Commands with more than one keybinding in menus, Thorsten Jolitz, 2013/08/13
- Re: Commands with more than one keybinding in menus, Michael Heerdegen, 2013/08/14
- Re: Commands with more than one keybinding in menus, Thorsten Jolitz, 2013/08/14
- Message not available
- Re: Commands with more than one keybinding in menus, Stefan Monnier, 2013/08/14
- Re: Commands with more than one keybinding in menus, Thorsten Jolitz, 2013/08/14
- Message not available
- Re: Commands with more than one keybinding in menus,
Stefan Monnier <=
- Re: Commands with more than one keybinding in menus, Thorsten Jolitz, 2013/08/14
Message not available