help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stop modes from hijacking several global keys


From: Nicolas Richard
Subject: Re: Stop modes from hijacking several global keys
Date: Wed, 05 Nov 2014 10:41:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (gnu/linux)

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



reply via email to

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