emacs-devel
[Top][All Lists]
Advanced

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

Re: Issues with quail.el


From: Amit Ramon
Subject: Re: Issues with quail.el
Date: Thu, 10 May 2018 17:12:34 +0300

Michael Welsh Duggan <address@hidden> [2018-05-08 23:19 -0400]:

I'm not a quail expert, but I looked through a lot of the code recently
to try to figure out how to do something else, so maybe I can figure out
how to help here.

Thanks, any help is appreciated.


First issue

Assume that the keyboard layout is set to "atari-german" and that the
input method is "Hebrew". When I type C-h I (thus invoking
"describe-input-method"), the drawing of the keyboard layout is
incorrect. The keys that appear in the shifted level, which should be,
in this input method, similar to those in the standard layout, are
actually taken from the current keyboard layout.

Okay, let's verify some things.  When I type
`M-x quail-show-keyboard-layout RET atari-german RET', I get the
following:

Keyboard layout (keyboard type: atari-german)

    +----------------------------------------------------------------+
    | 1! | 2" | 3§ | 4$ | 5% | 6& | 7/ | 8( | 9) | 0= | ß? | '` | #^ |
    +----------------------------------------------------------------+
      | qQ | wW | eE | rR | tT | zZ | uU | iI | oO | pP | üÜ | +* |
      +------------------------------------------------------------+
       | aA | sS | dD | fF | gG | hH | jJ | kK | lL | öÖ | äÄ | ~| |
    +--------------------------------------------------------------+
    | <> | yY | xX | cC | vV | bB | nN | mM | ,; | .: | -_ |
    +------------------------------------------------------+
                    +-----------------------------+
                    |          space bar          |
                    +-----------------------------+


Is this what you get as well?

Yes.

Does this match your actual keyboard?

No, but my actual keyboard isn't atari-german -- I gave it just as an
example. My physical keyboard is standard English QWERTY keyboard. On
my Linux system I setup a Dvorak layout. I made tests mostly with my
Dvorak setup[1] (there are footnotes at the end), but because Dvorak
keyboard layout is not one of Emacs' defined layouts I used
atari-german for the example.

For example, the Hebrew letter TET is on the (standard) y key, and
pressing this key together with shift when Hebrew input method is
active should produce Y. This works fine when typing, but in the map
drawn by "describe-input-method" the letter that appears on this key
in the shifted state is Z, which is what this key does in
"atari-german" layout. There are some other keys not in the right
place - all those that in "atari-german" have a meaning that is
different than the one in the standard layout.

Also to verify, the 'y' key is the one to diagonally down and to the
right of the 'a' key?  Like in the layout above?

Yes.

When I try to recreate what you are showing, I get the following.
Does this match?

    +----------------------------------------------------------------+
    | 1! | 2" | 3§ | 4$ | 5% | 6& | 7/ | 8( | 9) | 0( | ß? | '` | ;^ |
    +----------------------------------------------------------------+
      | qQ | 'W | ק‎E | ר‎R | א‎T | ט‎Z | ו‎U | ן‎I | ם‎O | פ‎P | ]} | [{ |
      +------------------------------------------------------------+
       | ש‎A | ד‎S | ג‎D | כ‎F | ע‎G | י‎H | ח‎J | ל‎K | ך‎L | ף‎Ö | ,Ä | ~| |
    +--------------------------------------------------------------+
    | >< | ז‎Y | ס‎X | ב‎C | ה‎V | נ‎B | מ‎N | צ‎M | ת‎> | ץ‎< | ._ |
    +------------------------------------------------------+
                   +-----------------------------+
                   |          space bar          |
                   +-----------------------------+


Yes.

Finally, if it does match, what should it look like instead?

This is what it should look like:

    +----------------------------------------------------------------+
    | 1! | 2@ | 3# | 4$ | 5% | 6^ | 7& | 8* | 9) | 0( | -_ | =+ | `~ |
    +----------------------------------------------------------------+
      | /Q | 'W | ק‎E | ר‎R | א‎T | ט‎Y | ו‎U | ן‎I | ם‎O | פ‎P | ]} | [{ |
      +------------------------------------------------------------+
       | ש‎A | ד‎S | ג‎D | כ‎F | ע‎G | י‎H | ח‎J | ל‎K | ך‎L | ף‎: | ," | \| |
       +-----------------------------------------------------------+
         | ז‎Z | ס‎X | ב‎C | ה‎V | נ‎B | מ‎N | צ‎M | ת‎> | ץ‎< | .? |
         +-------------------------------------------------+
                    +-----------------------------+
                    |          space bar          |
                    +-----------------------------+

Most of the differences are in the first shift level.

Note, for example, the location of the "Y" and "Z", and the two keys
right of the "L". This layout is the standard for a Hebrew keyboard
layout (the Israeli standard, at least), and this is what a Hebrew
writer would expect when Hebrew input method is set. (you can get it
simply if you don't change your keyboard layout -- assuming it is the
standard one -- and then set input method to Hebrew, and do C-h I.)

The point is that *there are no problems with actual typing* -- you
press Shift with the key that has the "Z" in your drawing (to remove
any possible confusion, this is the key that is right below 6 and 7
and on the center between them), and you'll get "Y".

The problem is only with the drawing created by C-h I -- I believe the
algorithm for creating this drawing is wrong, but it could also be a
problem of the way the Hebrew input method is defined[2] or maybe
both.

Second issue

[...]

Snipped until I have a clearer idea what the problem is.

Fair enough. Here is how to reproduce it.

I assume that your real keyboard is standard and that you're using the
standard keyboard layout (this is the default of Emacs).

1. Open a new buffer and set the input method to Hebrew (M-x
set-input-method).

2. Press the keys t, y, u (as on the standard keyboard, t is under 5 and
6, and then the two following keys). This will type the Hebrew letters
אטו (this is ALEF TEV VAV).

3. Place the pointer on the first letter, and do:

  M-x quail-show-key

You should get:

  To input 'א', type "t"

4. Now place the pointer on the second letter and do the same. You should
get:

  To input 'ט', type "y"

5. For the third letter, you should get:

  To input 'ו', type "u"

6. Now switch to atari-german keyboard layout and perform the same steps.

For the first and third letters you should get the same as above.

What I get for the second letter (TET, ט) is:

  ט can't be input by the current input method

Now, to prove that this message is incorrect, press the z on your
keyboard (physical z). This is kind of cheating, but because y and z
are swapped in atari-german, pressing z is like really giving Emacs y,
and vice versa. So try pressing either keys, y and z, and you'll see
that you can input TET.

I hope this helps to understand the problems.

Best,

--- Amit

[1] I set my Linux X window system to Dvorak layout with the following
shell command:

  $ setxkbmap -rules evdev -model pc104 -layout "us" -variant "dvorak"

So from Emacs' point of view the keyboard is really Dvorak. Note that
if the real keyboard layout is not the standard one, you should call
"quail-set-keyboard-layout" to set it for Emacs. However, for a reason
I don't understand Emacs doesn't have a definition for Dvorak layout[*]
so you have to use a hommade one. You can do that by evaluating the
following elisp code:

  (require 'quail)
  (add-to-list 'quail-keyboard-layout-alist
            `("dvorak" . ,(concat "                              "
                                   "  address@hidden&8*9(0)[{]}`~  "
                                   "  '\",<.>pPyYfFgGcCrRlL/?=+    "
                                   "  aAoOeEuUiIdDhHtTnNsS-_\\|    "
                                   "  ;:qQjJkKxXbBmMwWvVzZ        "
                                   "                              ")))

  (quail-set-keyboard-layout "dvorak")

If you actually evaluate this elisp code, you could call
"quail-set-keyboard-layout" once with "dvorak" and once with
"standard" and compare the results of C-h I (and for that you don't
have to change the actual layout of the keyboard).

* Emacs has (see quail.el) definitions for sun-type3, atari-german,
pc102-de, jp106 and pc105-uk keyboard layouts only, but not Dvorak
(anyone has an idea why? perhaps it is time to add it?)


[2] The definitions for the standard Hebrew input method ("hebrew" and
"hebrew-new") do not explicitly define the first shift level. Perhap
the author of it trusted quail to take this from the English standard
layout (the first shift level is identical, at least most of
it). However, perhaps it would be safer to completly define the Hebrew
layout, including the first shift level.



reply via email to

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