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: David Reitter
Subject: Re: Defining key onto copied global map problem
Date: Tue, 24 Feb 2009 17:39:01 -0500

On 24 Feb 2009, at 17:14, Stefan Monnier wrote:

(define-key (copy-keymap (current-global-map)) (kbd "M-c") 'ignore)

This creates a new keymap (of same content as the global map), modifies
it and then throws it away.

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.

"x" is in my global key-map,  while M-c isn't bound there.

I also tried something like

(setcdr  (copy-keymap (current-global-map)) '(foo))

which doesn't do anything to the global keymap either, so failing to copy the tail isn't the problem.

Further, note that the M-c binding doesn't show up in the original global map after the define-key call above; however, the binding becomes effective.


Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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