unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Reitter <david.reitter@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Tomohiro MATSUYAMA <t.matsuyama.pub@gmail.com>, emacs-devel@gnu.org
Subject: Re: Defining key onto copied global map problem
Date: Tue, 24 Feb 2009 17:39:01 -0500	[thread overview]
Message-ID: <2855C172-B555-47C1-A1C1-2440BEDFED30@gmail.com> (raw)
In-Reply-To: <jwvvdqzqy8w.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 877 bytes --]

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 #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

  reply	other threads:[~2009-02-24 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24  9:19 Defining key onto copied global map problem Tomohiro MATSUYAMA
2009-02-24 22:14 ` Stefan Monnier
2009-02-24 22:39   ` David Reitter [this message]
2009-02-25  0:11     ` Miles Bader
2009-02-25  4:54       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2855C172-B555-47C1-A1C1-2440BEDFED30@gmail.com \
    --to=david.reitter@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=t.matsuyama.pub@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).