From: Elena <egarrulo@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Clearing keybindings when redefining a minor mode map
Date: Mon, 27 Dec 2010 05:58:45 -0800 (PST) [thread overview]
Message-ID: <fa6a12fb-9920-4f4e-ac6a-40c7aff52405@j3g2000vbi.googlegroups.com> (raw)
In-Reply-To: mailman.6.1293434384.29764.help-gnu-emacs@gnu.org
On Dec 27, 7:19 am, Leo Alekseyev <dnqu...@gmail.com> wrote:
> Greetings all,
>
> Suppose I have a keybinding that is shared by two minor modes (mode A
> and mode B). I want to accomplish the following: if both modes A and B are
> active, then the keybinding should only invoke mode A's command.
>
> My original approach was to insert code in mode B's commands that checks if
> mode A is active, and if so, it creates a new keymap for mode B, with
> conflicts removed. Unfortunately, even though the new map is created
> properly, it
> doesn't remove the old keybindings that are in conflict with mode A. Is
> there an easy way to clear those keybindings?
>
> --Leo
Maybe you could put some code in mode B's hook to disable mode A if
enabled already and then enable it? This way you would be ensuring
mode A always gets enabled after mode B, thus shadowing mode B's map.
next parent reply other threads:[~2010-12-27 13:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.6.1293434384.29764.help-gnu-emacs@gnu.org>
2010-12-27 13:58 ` Elena [this message]
2010-12-28 2:57 ` Clearing keybindings when redefining a minor mode map Stefan Monnier
2010-12-27 7:19 Leo Alekseyev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa6a12fb-9920-4f4e-ac6a-40c7aff52405@j3g2000vbi.googlegroups.com \
--to=egarrulo@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.