all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: rms@gnu.org
Cc: lekktu@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca,
	jasonr@gnu.org
Subject: Re: kbd vs read-key-sequence
Date: Mon, 19 Mar 2007 21:25:19 +0900	[thread overview]
Message-ID: <E1HTGvP-0005NP-UP@etlken.m17n.org> (raw)
In-Reply-To: <E1HTACo-0003Q9-5f@fencepost.gnu.org> (message from Richard Stallman on Mon, 19 Mar 2007 01:14:50 -0400)

In article <E1HTACo-0003Q9-5f@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:

>     At first, encoded-kbd-mode is designed to be used in the
>     case that Emacs is invoked with -nw, 

> I am not sure what that statement means.  Does it mean that

>    encoded-kbd-mode was designed originally to be used in -nw

> or does it mean that

>    encoded-kbd-mode is intended originally to be used in -nw

> Which one?

Both.  It was designed to be used in -nw and it still keeps
that design, and thus it is intended to be used in -nw.
Please note that "decoding" means to convert a byte sequence
to a character sequence.  On terminal, what Emacs receives
is surely a byte sequnece.  But on windows, what Emacs
receive is an window event, and it's a responsibility of
window-event handler to convert it to a character event.
And what window-event handler returns is a character,
applying "decoding" on it is not the right thing.

>     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.

> That might be a good thing, but since you can't do it now,
> can we fix encoded-kbd-mode to handle modifiers correctly?
> It probably is not very hard.

Implementing it in C doesn't solve the current problem.
Still, Windows code should be fixed to generate a correct
(multibyte) character event.  And, once Windows code is
fixed, we don't have to touch encoded-kbd-mode now.

And, changing encoded-kbd-mode is not very hard, but hard
enough to make me hesitate to do before the release.

> > 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-é.

> I do not follow that argument.  If users write (meta ?<encoded-?>),
> why would that cause any problem anywhere?

Here, I think what he meant by "(meta ?<encoded-?>)" is a
code something like this ("\351" part is of 4 chars):

(global-set-key [(meta ?\351)] ...)

Then, it works only for w32.  Another way is to visit .emacs
as unibyte file, put "coding: raw-text;" tag, write as below
("\351" part is of 1 eight-bit char), and save it as
raw-text.

(global-set-key [(meta ?\351)] ...)

But, this also works only for w32.

Both depends on that the event ?\M-\351 is generated, but X
generates ?\M-é.

> 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.

> What should be used instead?  If there is nothing that works,
> I suggest that people who care about Windows support either fix this
> now, or implement something else now.

I do suggest the former.

I don't know how Windows port handles a keyboad event, but
considering that it depends on encoded-kbd-mode to work,
perhaps it returns a raw-byte (maybe with modifiers)
sequence as a character event sequence.  What it should do
is to decode those raw-bytes by locale-coding-system.

In emacs-unicode-2, I think it is much easier because I
believe Windows itself has a facility to convert keyboard
events to Unicode character.

---
Kenichi Handa
handa@m17n.org

  reply	other threads:[~2007-03-19 12:25 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-28 22:27 kbd vs read-key-sequence Juanma Barranquero
2007-02-28 22:40 ` Andreas Schwab
2007-02-28 22:50   ` Lennart Borgman (gmail)
2007-02-28 23:32   ` Juanma Barranquero
2007-03-01  1:35     ` Juanma Barranquero
2007-03-01  5:28       ` Stefan Monnier
2007-03-01 12:48         ` Juanma Barranquero
2007-03-01 15:32           ` Stefan Monnier
2007-03-01 17:30             ` Juanma Barranquero
2007-03-01 23:23               ` Stefan Monnier
2007-03-01 23:53                 ` Juanma Barranquero
2007-03-02  0:03                   ` Juanma Barranquero
2007-03-02  9:09                     ` Jason Rumney
2007-03-02  9:48                       ` Juanma Barranquero
2007-03-02 16:47                   ` Stefan Monnier
2007-03-02 17:29                     ` Juanma Barranquero
2007-03-02 17:57                       ` Jason Rumney
2007-03-02 18:15                         ` Juanma Barranquero
2007-03-02 18:20                           ` David Kastrup
2007-03-02 21:03                           ` Stefan Monnier
2007-03-03  0:31                             ` Juanma Barranquero
2007-03-03 22:13                             ` Richard Stallman
2007-03-03 23:01                               ` Stefan Monnier
2007-03-05  2:55                                 ` Richard Stallman
2007-03-05 17:10                                   ` Stefan Monnier
2007-03-11 20:01                                     ` Richard Stallman
2007-03-12 15:19                                       ` Stefan Monnier
2007-03-13  1:17                                         ` Kenichi Handa
2007-03-13  3:12                                           ` Stefan Monnier
2007-03-13  4:06                                             ` Kenichi Handa
2007-03-13 14:47                                               ` Stefan Monnier
2007-03-19  5:14                                           ` Richard Stallman
2007-03-19 12:25                                             ` Kenichi Handa [this message]
2007-03-19 14:19                                               ` Kim F. Storm
2007-03-26  3:52                                               ` Richard Stallman
2007-03-26  7:22                                                 ` Kenichi Handa
2007-03-26 23:14                                                   ` Richard Stallman
2007-03-27  0:30                                                     ` Kenichi Handa
2007-03-27 16:42                                                       ` Richard Stallman
2007-03-28  0:29                                                         ` Kenichi Handa
2007-03-29 15:32                                                           ` Richard Stallman
2007-03-29 16:11                                                             ` Stefan Monnier
2007-03-30 21:23                                                               ` Richard Stallman
2007-03-31  0:38                                                                 ` Stefan Monnier
2007-03-31 10:07                                                                   ` Eli Zaretskii
2007-03-31 23:20                                                                     ` Richard Stallman
2007-04-01  3:09                                                                       ` Eli Zaretskii
2007-04-01 13:59                                                                         ` Richard Stallman
2007-04-01 19:14                                                                           ` Stefan Monnier
2007-04-01 20:18                                                                             ` Jason Rumney
2007-04-01 20:35                                                                               ` Stefan Monnier
2007-04-02 12:00                                                                                 ` Eli Zaretskii
2007-04-02  2:27                                                                               ` Kenichi Handa
2007-04-02 11:58                                                                                 ` Eli Zaretskii
2007-04-02 12:31                                                                                   ` Kenichi Handa
2007-04-02 12:46                                                                                     ` Eli Zaretskii
2007-04-02 14:33                                                                                       ` Stefan Monnier
2007-04-02 16:14                                                                                     ` Jason Rumney
2007-04-02 23:24                                                                                       ` Davis Herring
2007-04-03  6:58                                                                                         ` Jason Rumney
2007-04-03  7:46                                                                                       ` Richard Stallman
2007-04-03  8:42                                                                                         ` Eli Zaretskii
2007-04-03 14:58                                                                                           ` Stefan Monnier
2007-04-03 15:34                                                                                             ` Eli Zaretskii
2007-04-03 17:59                                                                                               ` Stefan Monnier
2007-04-03 18:20                                                                                                 ` Eli Zaretskii
2007-04-03 18:33                                                                                                   ` Stefan Monnier
2007-04-04 14:02                                                                                                 ` Richard Stallman
2007-04-04 14:02                                                                                             ` Richard Stallman
2007-04-03  9:05                                                                                         ` Jason Rumney
2007-04-03  9:37                                                                                           ` Eli Zaretskii
2007-04-03 10:24                                                                                             ` Jason Rumney
2007-04-04 14:02                                                                                           ` Richard Stallman
2007-04-03 10:12                                                                                       ` Eli Zaretskii
2007-04-04 14:02                                                                                         ` Richard Stallman
2007-04-04 18:03                                                                                           ` Eli Zaretskii
2007-03-31 20:42                                                                   ` Richard Stallman
2007-03-31 21:44                                                                     ` Eli Zaretskii
2007-03-31 22:06                                                                       ` Juanma Barranquero
2007-03-30  0:47                                                             ` Kenichi Handa
2007-03-30  3:25                                                               ` Stefan Monnier
2007-03-31 10:03                                                                 ` Eli Zaretskii
2007-03-31 20:27                                                                   ` Stefan Monnier
2007-03-30 21:22                                                               ` Richard Stallman
2007-03-31 10:02                                                               ` Eli Zaretskii
2007-03-19  5:14                                         ` Richard Stallman
2007-03-26 23:14                                         ` Richard Stallman
2007-03-28  0:57                                           ` Stefan Monnier
2007-03-28 16:09                                             ` Richard Stallman
2007-03-28 19:52                                               ` Stefan Monnier
2007-03-29 17:59                                                 ` Richard Stallman
2007-03-30 23:47                                               ` Chong Yidong
2007-03-31  9:08                                                 ` Eli Zaretskii
2007-03-03 22:13                           ` Richard Stallman
2007-03-02 18:21                         ` Juanma Barranquero
2007-03-02 19:04                           ` Jason Rumney
2007-03-03 10:39                       ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1HTGvP-0005NP-UP@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=jasonr@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.