[Top][All Lists]

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

RE: single-key-description no good for Japanese and Chinese chars

From: Drew Adams
Subject: RE: single-key-description no good for Japanese and Chinese chars
Date: Fri, 22 Sep 2006 14:00:40 -0700

    >> My question is this: Why do these keys have as their binding
    >> `self-insert-command'?

    >     Because that is the binding for all characters of that group.

    > That sounds like "because that's the way it is".  Care to
    > elaborate? The question is not how it is done, but why it is
    > done that way.

    When someone enters such a character (typically via XIM or
    quail), he/she
    presumably wants to insert it, so it seems eminently natural to bind all
    those chars to self-insert-command.

But if the function `self-insert-command' has certain
dependencies/limitations/expectations, then perhaps another self-inserting
function should be used for such "invalid" keys - `self-insert-invalid-key'

Except for these "invalid" keys, you can use `read-kbd-macro' and call
`self-insert-command' on a key from `map-keymaps' to insert it (after
setting `last-command-char').

    > So what? Binding thousands of characters is something
    > computers are good at.
    > Or are you saying that that would affect performance in an
    > unacceptable way?

    What would be the benefit of binding each char individually?
    I don't think it's terribly important which way it's done, but
    the current
    way at least has the advantage of being less inefficient.

I said (see next), that if the problem is efficiency, then do the same thing
as now, but with a different function, and reserve `self-insert-command' for
its normal role: inserting the `last-command-char'.

    > If so, what's special about `self-insert-command' - why not
    > bind them all to
    > a different command, `foobar', which does what is needed, so
    > they don't get
    > in the way of the normal, simple, straightforward relations between
    > `self-insert-command', `single-key-description', and `read-kbd-macro'?

    I see no relation between self-insert-command and the other two.

See above. I think that Handa explained that you cannot use
`self-insert-command' to insert such keys, but I might have misunderstood.
And I would like to be able to pick up a key from `map-keymaps' and execute
its command (binding). I would expect command `self-command-insert' to
insert the key, and that doesn't work for the "invalid" keys.

    > A program might well expect `self-insert-command' to do what it says
    > straightforwardly: insert the key as a character.

    What makes you think it doesn't do exactly that?

See above, and Handa's comment that "it doesn't work, it signals an error."

And I tried it, and it didn't work for me: get the key via `map-keymap', get
its `single-key-description', get `read-kbd-macro' of that, set
`last-command-char' to that, and call `self-insert-command'. OK for all keys
except these "invalid" keys. Seems like a reasonable operation to expect you
could do, no?

    > My program did, and this new feature has hardly been released
    > yet (AFAIK, it's new in Emacs 22).

    I don't think this is was significantly changed since Emacs-21
    (or probably
    even Emacs-20.4).  So the cause of your problem might be somewhere else.
    Please then tell us exactly what is the behavior you used to
    see compared to what you see now.

I'm no doubt wrong about that - I thought it was new with 22. What is new,
in any case, is `map-keymap', so this is the first time I've run into such
"invalid" keys (using `map-keymap').

reply via email to

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