From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#8807: map-char-table alters cons cells used as events Date: Mon, 06 Jun 2011 02:57:40 -0400 Message-ID: References: <4DEC5C8B.3030803@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1307343515 19382 80.91.229.12 (6 Jun 2011 06:58:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2011 06:58:35 +0000 (UTC) Cc: 8807@debbugs.gnu.org To: Jonathan Ganc Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 06 08:58:27 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QTTlb-0002fu-JF for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jun 2011 08:58:27 +0200 Original-Received: from localhost ([::1]:58120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTTla-00044J-IZ for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jun 2011 02:58:26 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTTlF-00043n-8s for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2011 02:58:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QTTlD-0002i7-72 for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2011 02:58:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTTlC-0002hy-Qk for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2011 02:58:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QTTlC-00054S-6b; Mon, 06 Jun 2011 02:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jun 2011 06:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8807 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8807-submit@debbugs.gnu.org id=B8807.130734346819328 (code B ref 8807); Mon, 06 Jun 2011 06:58:02 +0000 Original-Received: (at 8807) by debbugs.gnu.org; 6 Jun 2011 06:57:48 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTTkx-00051d-Ki for submit@debbugs.gnu.org; Mon, 06 Jun 2011 02:57:47 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTTkw-00051K-0F for 8807@debbugs.gnu.org; Mon, 06 Jun 2011 02:57:46 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1QTTkq-0002sA-Lq; Mon, 06 Jun 2011 02:57:40 -0400 In-reply-to: <4DEC5C8B.3030803@gmail.com> (message from Jonathan Ganc on Sun, 05 Jun 2011 23:50:19 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 06 Jun 2011 02:58:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46993 Archived-At: > Date: Sun, 05 Jun 2011 23:50:19 -0500 > From: Jonathan Ganc > > (let ((ct (make-char-table 'keymap)) permev) > (set-char-table-range ct '(1 . 2) 'binding) > (map-char-table > (lambda (event defn) > (setq permev event) > (insert (prin1-to-string permev))) > ct) > (insert (concat "\n" (prin1-to-string permev))) > ) > > This produces: > (1 . 2) > (3 . 4194303) > , so that map-char-table alters the cons cell being used as an output > range than producing a new one. The char-table produced by make-char-table is originally comprised of a single range of characters with a single value of nil. After the call to set-char-table-range, that range is split in 2: character codes 1 and 2 get the value of 'binding, the rest are left with nil. Thus, map-char-table calls its 2nd argument twice, one each for every range of characters in the table that share the same value. > I would have expected: > (1 . 2) > (1 . 2) ??? Why? And where do you see that map-char-table alters the cons cell being used as output? What output?