From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Stop modes from hijacking several global keys
Date: Wed, 05 Nov 2014 10:41:30 +0100 [thread overview]
Message-ID: <87lhnqougl.fsf@yahoo.fr> (raw)
In-Reply-To: <87sihy3yuv.fsf@thinkpad-t440p.tsdh.org> (Tassilo Horn's message of "Wed, 05 Nov 2014 08:12:08 +0100")
Tassilo Horn <tsdh@gnu.org> writes:
> Tassilo Horn <tsdh@gnu.org> writes:
>
>> Ideally, that magic would stop the mode from hijacking M-<number>
>> keys, and whatever it wants to bind to M-<number> would automagically
>> be bound to `<escape> M-<number>' instead.
>>
>> I think at least for major-modes I can use
>> `after-change-major-mode-hook' in combination with a function checking
>> (key-binding (kbd "M-<number>")) and doing `local-set-key' if needed.
Since minor modes have precedence of major modes, you could define your
own minor mode with those keybindings.
If you use John Wiegley's bind-key (or use-package), you already have
such a minor mode : override-global-mode. bind-key* will add bindings to
it.
--
Nicolas Richard
next prev parent reply other threads:[~2014-11-05 9:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-05 7:02 Stop modes from hijacking several global keys Tassilo Horn
2014-11-05 7:12 ` Tassilo Horn
2014-11-05 9:41 ` Nicolas Richard [this message]
2014-11-05 11:38 ` Tassilo Horn
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lhnqougl.fsf@yahoo.fr \
--to=theonewiththeevillook@yahoo.fr \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).