help-gnu-emacs
[Top][All Lists]
Advanced

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

Weirdness with Input Method/quail : how to figure out source of it?


From: Vladimir Lomov
Subject: Weirdness with Input Method/quail : how to figure out source of it?
Date: Wed, 14 Aug 2013 21:42:38 +0900
User-agent: Mutt/1.5.21 (2010-09-15)

Hello,
I need advice how to solve or find out source of my weird problem with Input 
Method. I apologize
for long description but I think it might help.

My setup:
- two languages: English and Russian;
- standard QWERTY keyboard, *but* DVORAK layout for both terminal and X;
- standard Russian layout (ЙЦУКЕН).

Due to DVORAK layout English letters shown on screen don't coincide with 
letters on pressed
keys, for example pressing keys with letters
  qwerty
on keyboard gives on screen
  ',.pyf

* Problem 0

If layout were QWERTY and one uses 'russian-computer' Input Method then letters 
on keys and
typed symbols, both English and Russian, are coincide. For instance, some part 
of QWERTY
keyboard:

  +-------+-------+-------+-------+-------+-------+
  | Q     | W     | E     | R     | T     | Y     |...
  |       |       |       |       |       |       |
  |     Й |     Ц |     У |     К |     Е |     Н |...
  +-------+-------+-------+-------+-------+-------+

(Input Method 'russian-computer' is defined by leim/quail.)

But if layout is DVORAK then pressing keys with letters QWERTY give
  ',.pyf
so 'russian-computer' gives wrong result.

To get correct output for Russian I decided to define new keyboard layout 
('dvorak-classic') for
quail (this is not my discovery I found it on emacswiki.org).

So problem 0: how to enter Russian letters as they are depicted on keyboard 
using dvorak layout?
This problem is solved by means of new keyboard layout 'dvorak-classic'.

But this solution rises another weird problem. Looking ahead I must say that I 
notice this
problem about 4-6 months ago while I use this setup (dvorak layout) for more 
than a year.

* Problem 1

Sometimes, when writing text on Russian, pressing on keys with punctuation 
symbols gives
(Russian) letters instead. This effect comes not always, but to get desired 
punctuation symbol I
have to either switch twice Input Method (C-\ C-\) or move one character back 
or line up then
return to the same point and enter the symbol (press the same key). Other 
oddities:
- pressing in sequence the same key gives the same wrong letter;
- I may press SPACE, then delete it, delete wrong letter and press the key 
again, and again get
  wrong letter;
- if I don't fix wrong letter and continue to type text further (space and 
press keys with
  Russian letters), all letters are ok until next punctuation symbol.

Why I call it "weird" problem: because it comes not always, it is very 
sporadic. It doesn't
depend if I run Emacs with my settings or without any (emacs -Q), in terminal 
(tty) or in
graphical environment (X). (The only difference I noticed when I checked Emacs 
running with my
settings and without any is that with my settings problem comes more quickly.) 
The other
dependency I noticed: when I type text quickly or if system is slow (one of my 
computer is
relatively old notebook) then effect comes earlier.

So the question is: how to "debug" this problem? Is there any option in Emacs 
to record what
functions are called to figure out why symbols are changed?

* Details on this problem

I wasn't able to prepare small/minimal working (unworking) example (actually 
that's why I ask how
to "debug") so I describe symptoms: when I want to enter punctuation symbols 
(comma [,], point
[.], colon [:], semicolon [;], dash [-], single quote ['], double quote ["]) 
while typing
Russian text I press keys with corresponding symbols (Russian layout) but 
instead of punctuation
symbols I get:

  . -> у
  , -> ц
  : -> Я
  ; -> я
  ' -> й
  " -> Й
  - -> э

I think there are double "tranformation" (by quail). Why I think so? For 
example, to get [,] I
press key on QWERTY keyboard:

  +--------+
  | ?    , |
  |        |
  | /    . |
  +--------+
    Q    R

(here Q means QWERTY keyboard and QWERTY layout, while R means Russian layout) 
but in DVORAK
layout the same key gives zZ:

  +--------+
  | Z    , |
  |        |
  | z    . |
  +--------+
    D    R

In quail 'dvorak' layout there is mapping (transformation):

  z -> .
  Z -> ,

On the other hand, these punctuation symbols on DVORAK layout comes with 
following Russian
letters:

  +--------+--------+
  | <    Ц | >    У |
  |        |        |
  | ,    ц | .    у |
  +--------+--------+
    D    R   D    R

That why I think there is double transformation: when I enter [z|Z] quail 
transforms it to [.|,]
but (this is my suspicion) for some reason quail continues transformation 
taking new symbol as
input.

To figure out the reason why this is happening I need to know how quail works 
'under the
hood'. Is it possible?

Page on EmacsWiki:
http://www.emacswiki.org/emacs/WritingRussianWithDvorak

My variant of quail 'dvorak' layout:
https://raw.github.com/vp1981/scripts/master/emacs.d/misc/quail-dvorak.el


P.S. Please keep me in CC, I'm not subscribed to this ML.

---
WBR, Vladimir Lomov

-- 
A father doesn't destroy his children.
                -- Lt. Carolyn Palamas, "Who Mourns for Adonais?",
                   stardate 3468.1.



reply via email to

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