[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kbd vs read-key-sequence

From: Kenichi Handa
Subject: Re: kbd vs read-key-sequence
Date: Tue, 13 Mar 2007 10:17:10 +0900
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)

I'm very sorry to being late to join this thread.

In article <address@hidden>, Stefan Monnier <address@hidden> writes:

> >     Because the way the event is decoded through read-key-sequence is not
> >     necessarily the same.  E.g. while ?<encoded-?> may get turned into ??, 
> > it
> >     may be the case that ?\M-<encoded-?> 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 /
                \           /
                 \         /              
                 input method   

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 ?<encoded-?>).
> > 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 correctly
> decodes such a key-combination into ?\M-é.

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-<encoded-?>
into ?\M-é 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

Kenichi Handa

reply via email to

[Prev in Thread] Current Thread [Next in Thread]