[Top][All Lists]

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

Re: unexpected result with keymap inheritance

From: Stefan Monnier
Subject: Re: unexpected result with keymap inheritance
Date: Mon, 21 Nov 2016 09:12:58 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> (set-keymap-parent parent-map global-map)

Since `key-binding` checks global-map after the buffer-local map anyway,
putting global-map as the parent of your buffer-local map has basically
no effect.

> (define-key child-map [?a] nil)

This does not *remove* a binding from child-map.  Instead it marks the
key as unbound, thus hiding any potential corresponding binding in
parent keymaps.

Emacs does not provide a "remove binding" operation on keymaps.

> (key-binding [?a])
> => self-insert-command

Here the binding was not found in the buffer-local map but in the global
map instead.


reply via email to

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