From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: Defining key onto copied global map problem Date: Wed, 25 Feb 2009 09:11:51 +0900 Message-ID: <87r61npe7s.fsf@catnip.gol.com> References: <3c863ca40902240119s41b53caah3824d4679619d534@mail.gmail.com> <2855C172-B555-47C1-A1C1-2440BEDFED30@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1235520745 13067 80.91.229.12 (25 Feb 2009 00:12:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Feb 2009 00:12:25 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 25 01:13:42 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lc7P6-0002iT-Ct for ged-emacs-devel@m.gmane.org; Wed, 25 Feb 2009 01:13:36 +0100 Original-Received: from localhost ([127.0.0.1]:52329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lc7Nl-0002mN-MM for ged-emacs-devel@m.gmane.org; Tue, 24 Feb 2009 19:12:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lc7Ng-0002m6-Qo for emacs-devel@gnu.org; Tue, 24 Feb 2009 19:12:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lc7Ne-0002lO-71 for emacs-devel@gnu.org; Tue, 24 Feb 2009 19:12:07 -0500 Original-Received: from [199.232.76.173] (port=48521 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lc7Ne-0002lL-2U for emacs-devel@gnu.org; Tue, 24 Feb 2009 19:12:06 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:33877 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lc7Nd-0007tH-Q6 for emacs-devel@gnu.org; Tue, 24 Feb 2009 19:12:06 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Lc7Nb-0007Vp-Fd for emacs-devel@gnu.org; Wed, 25 Feb 2009 00:12:03 +0000 Original-Received: from 218.231.175.8.eo.eaccess.ne.jp ([218.231.175.8]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 Feb 2009 00:12:03 +0000 Original-Received: from miles by 218.231.175.8.eo.eaccess.ne.jp with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 Feb 2009 00:12:03 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 24 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 218.231.175.8.eo.eaccess.ne.jp System-Type: x86_64-unknown-linux-gnu Cancel-Lock: sha1:jlvBvGFUW4D7oPaOF6OL7qvy+oI= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109322 Archived-At: David Reitter 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.