[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
unexpected result with keymap inheritance
From: |
Ernest Adrogué |
Subject: |
unexpected result with keymap inheritance |
Date: |
Mon, 21 Nov 2016 01:28:38 +0100 |
User-agent: |
NeoMutt/20161014 (1.7.1) |
Hi there,
when I remove a binding from a child keymap that is shadowing a binding from
its parent keymap, the resulting binding for the key is not the one in the
parent keymap but the binding from the parent's parent keymap:
(setq parent-map (make-sparse-keymap))
(setq child-map (make-sparse-keymap))
(set-keymap-parent parent-map global-map)
(set-keymap-parent child-map parent-map)
(define-key parent-map [?a] 'backward-char)
(use-local-map child-map)
(key-binding [?a])
=> backward-char
(define-key child-map [?a] 'forward-char)
(key-binding [?a])
=> forward-char
(define-key child-map [?a] nil)
(key-binding [?a])
=> self-insert-command
I thought the last line would evaluate to backward-char. Is this how it's
supposed to work or is it some kind of bug?
Cheers.
- unexpected result with keymap inheritance,
Ernest Adrogué <=
- Re: unexpected result with keymap inheritance, Stefan Monnier, 2016/11/21
- Re: unexpected result with keymap inheritance, Alex Kost, 2016/11/21
- Re: unexpected result with keymap inheritance, Stefan Monnier, 2016/11/22
- Re: unexpected result with keymap inheritance, Alex Kost, 2016/11/22
- Re: unexpected result with keymap inheritance, Stefan Monnier, 2016/11/22
- Re: unexpected result with keymap inheritance, Alex Kost, 2016/11/23
- Re: unexpected result with keymap inheritance, Stefan Monnier, 2016/11/23
- Re: unexpected result with keymap inheritance, Alex Kost, 2016/11/23
- Re: unexpected result with keymap inheritance, Stefan Huchler, 2016/11/24
- Re: unexpected result with keymap inheritance, Ernest Adrogué, 2016/11/23