unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Weirdness with Input Method/quail : how to figure out source of it?
@ 2013-08-14 12:42 Vladimir Lomov
  2013-08-15 20:59 ` Alex Kost
  0 siblings, 1 reply; 11+ messages in thread
From: Vladimir Lomov @ 2013-08-14 12:42 UTC (permalink / raw)
  To: help-gnu-emacs

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.



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-08-22 14:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-14 12:42 Weirdness with Input Method/quail : how to figure out source of it? Vladimir Lomov
2013-08-15 20:59 ` Alex Kost
2013-08-15 23:19   ` Vladimir Lomov
2013-08-16  6:32     ` Alex Kost
2013-08-16  7:31       ` Vladimir Lomov
2013-08-16  9:45         ` ISHIKAWA,chiaki
2013-08-19  9:03           ` Vladimir Lomov
2013-08-16 11:37         ` Alex Kost
2013-08-19  8:58           ` Vladimir Lomov
2013-08-20  8:33           ` Vladimir Lomov
2013-08-22 14:58             ` Alex Kost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).