emacs-devel
[Top][All Lists]
Advanced

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

Re: Defining key onto copied global map problem


From: Miles Bader
Subject: Re: Defining key onto copied global map problem
Date: Wed, 25 Feb 2009 09:11:51 +0900

David Reitter <address@hidden> writes:
>>>    (define-key (copy-keymap (current-global-map)) (kbd "M-c") 'ignore)
>
> Which is why changing the copy of the keymap should have no effect - 
> but it does.  I reproduce on Emacs 22.
>
> Note that
>   (define-key (copy-keymap (current-global-map)) (kbd "x") 'ignore)
> works as expected, i.e. it does nothing.

I think the reason is that global meta bindings are looked up in the
ESC-prefix map, which is referenced in the top-level keymap using a
symbolic reference, not as an embedded keymap.

Even if copy-keymap recursively copies embedded keymaps, it does not
seem to recursively copy such symbolic references (which makes sense I
suppose).

(lookup-key (current-global-map) "\e") => ESC-prefix

-Miles

-- 
Patience, n. A minor form of despair, disguised as a virtue.





reply via email to

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