unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Miles Bader <miles@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: Defining key onto copied global map problem
Date: Wed, 25 Feb 2009 09:11:51 +0900	[thread overview]
Message-ID: <87r61npe7s.fsf@catnip.gol.com> (raw)
In-Reply-To: 2855C172-B555-47C1-A1C1-2440BEDFED30@gmail.com

David Reitter <david.reitter@gmail.com> 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	other threads:[~2009-02-25  0:11 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
2009-02-25  0:11     ` Miles Bader [this message]
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=87r61npe7s.fsf@catnip.gol.com \
    --to=miles@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).