unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jonathan Ganc <jonpublic2@gmail.com>
Cc: 8807@debbugs.gnu.org
Subject: bug#8807: map-char-table alters cons cells used as events
Date: Mon, 06 Jun 2011 02:57:40 -0400	[thread overview]
Message-ID: <E1QTTkq-0002sA-Lq@fencepost.gnu.org> (raw)
In-Reply-To: <4DEC5C8B.3030803@gmail.com> (message from Jonathan Ganc on Sun,  05 Jun 2011 23:50:19 -0500)

> Date: Sun, 05 Jun 2011 23:50:19 -0500
> From: Jonathan Ganc <jonpublic2@gmail.com>
> 
> (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?





  reply	other threads:[~2011-06-06  6:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06  4:50 bug#8807: map-char-table alters cons cells used as events Jonathan Ganc
2011-06-06  6:57 ` Eli Zaretskii [this message]
2011-06-06  7:04 ` Kenichi Handa

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=E1QTTkq-0002sA-Lq@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=8807@debbugs.gnu.org \
    --cc=jonpublic2@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).