From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: kbd vs read-key-sequence Date: Tue, 13 Mar 2007 10:17:10 +0900 Message-ID: References: <45E8657D.4080202@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1173748674 15704 80.91.229.12 (13 Mar 2007 01:17:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Mar 2007 01:17:54 +0000 (UTC) Cc: lekktu@gmail.com, emacs-devel@gnu.org, rms@gnu.org, jasonr@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 13 02:17:47 2007 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 1HQve6-0003Yb-B9 for ged-emacs-devel@m.gmane.org; Tue, 13 Mar 2007 02:17:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQveo-0002Rw-JV for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2007 20:18:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HQveZ-0002NN-ST for emacs-devel@gnu.org; Mon, 12 Mar 2007 21:18:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HQveY-0002K9-4W for emacs-devel@gnu.org; Mon, 12 Mar 2007 21:18:15 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQveX-0002Jp-VF for emacs-devel@gnu.org; Mon, 12 Mar 2007 20:18:13 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HQvdh-0004JA-QE; Mon, 12 Mar 2007 21:17:22 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id l2D1HBVB020711; Tue, 13 Mar 2007 10:17:11 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id l2D1HBEp011365; Tue, 13 Mar 2007 10:17:11 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id l2D1HAQJ001766; Tue, 13 Mar 2007 10:17:10 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.63) (envelope-from ) id 1HQvdW-0007G3-Ie; Tue, 13 Mar 2007 10:17:10 +0900 In-reply-to: (message from Stefan Monnier on Mon, 12 Mar 2007 11:19:19 -0400) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.95 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) X-detected-kernel: Solaris 8 (1) 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:67827 Archived-At: I'm very sorry to being late to join this thread. In article , Stefan Monnier writes: > > Because the way the event is decoded through read-key-sequence is n= ot > > necessarily the same. E.g. while ? may get turned into = ??, it > > may be the case that ?\M- stays unchanged. > > How does that happen? > See the OP. It seems that encoded-kb.el has such a limitation (it should > probably be considered as a bug, but there may be good reasons for it, > I don't know). At first, encoded-kbd-mode is designed to be used in the case that Emacs is invoked with -nw, and it uses key-translation-map to handle character events from 0 to 255 (that's all what happens with -nw). I think the following diagram is the right thing to do: window-system terminal | | | window event | character event 0..255 | | handle_one_xevent keyboad-coding-system decoder \ / \ lispy event / \ / \ / =20 read_char=20 | input method =20 | keymap And, it's in my todo list to abolish encoded-kbd-mode and implement keyboard-coding-system decoder in C for long, but unfortunately I still don't have a time to do that. > > Maybe that is a bug; if so, we should fix it. > That's what this thread is about supposedly. > > We could recommend that people write (meta ?). > > That would eliminate this particular problem, right? > No. It would make it work on those systems which have the bug (e.g. w32 > right now), but would not work on systems where read-key-sequence correct= ly > decodes such a key-combination into ?\M-=E9. As shown in the previous diagram, I think it's a bug of w32 code if it doesn't convert such an event as ?\M- into ?\M-=E9 because only a window system generates such an event and knows how to encode it. > > These do not make things perfect, but I think they might be enough > > to enable users to get reliable results. What do you think? > I don't think it'll really be reliable, but we can definitely provide > guidelines and hints. One guideline is not to use encoded-kbd-mode on window system. --- Kenichi Handa handa@m17n.org