[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weirdness with Input Method/quail : how to figure out source of it?
From: |
Alex Kost |
Subject: |
Re: Weirdness with Input Method/quail : how to figure out source of it? |
Date: |
Thu, 22 Aug 2013 18:58:10 +0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Vladimir Lomov (2013-08-20 12:33 +0400):
> Seems now I able to reproduce that behaviour with simple script.
>
> Would you mind to run this script (see attachment)? It's the only
> requirement is xdotool tool, you don't even have to switch to dvorak
> layout; moreover, qwerty layout is required to run script without
> intervention.
Hello and sorry for the long wait.
Actually dvorak is my default layout, so i don't need to switch to it, i
have to switch to qwerty one. (It's just a note)
At first i should say that i was faced with strange and unpredictable
results of xdotool (see below).
> What this script do:
> 1. run emacs without any settings but loading 'quail-dvorak.el' file
> (attached as well) and switching _on_ flyspell mode;
> 2. open a text file to type;
> 3. use a sample text file (xmpl.txt, attached) to type in opened buffer;
> 4. after first round of type, switch _off_ flyspell mode and type the
> same sample file again.
>
> To run script just open a terminal emulator and run
> ./test-emacs-flyspell-mode.sh xmpl.txt
> in directory with script and sample file.
>
> If it would give wrong behaviour for you then I send a bug report.
Your script didn't work for me because toggle-input-method prompts for a
method when it is evaluated for the first time (i use GNU Emacs 24.3.1
by the way), so i modified emacs command:
emacs -Q -l 'quail-dvorak.el' --name EmacsDebug sample.txt --eval '(setq
default-input-method "russian-computer")' --eval '(toggle-input-method)' --eval
'(flyspell-mode)' &
After that i tested this script 3 times with different "sets of layouts":
1. My default configuration.
To have dvorak layout as default in X i have a file
</etc/X11/xorg.conf.d/11-keyboard-layout.conf> with this contents:
Section "InputClass"
Identifier "keyboard-layout"
MatchIsKeyboard "true"
Option "XkbLayout" "dvorak,ru,us"
Option "XkbOptions" "grp:ctrl_shift_toggle"
EndSection
When i run the script, i got:
Всем известны цвета радуги: красный. оранжевый. жёлтый. зелёный. голубой и
фиолетовый.
Наше дело правое --- мы победим!
(There are dots after the names of colors, not commas.)
After "M-x" i got "flyspell[mode" instead of "flyspell-mode" printed,
so this mode wasn't turned off, and the second part of loop printed
text in minibuffer (as there is no match for "flyspell[mode"). As "-"
in qwerty is placed where "[" is placed in dvorak, i tried this
command in the script:
xdotool type --window ${app_id} "flyspell'mode"
but "flyspell'mode" stays unmodified.
2. I changed "XkbLayout" to "us,dvorak", restarted X and got these
results:
Вслм иквлстеы бвлта разваи: щрасеыч, ораежлвыч, жёлтыч, кллёеыч, аолвбоч и
фиоллтовыч.
Еапл злло правол эээ Мы поблзим!
Flyspell-mode wasn't turned off again. This time i got
"yptsrepp-mode" in minibuffer.
3. At last i just left "us" (i didn't modify config file this time,
but used "setxkbmap us" instead).
Всем известны цвета радуги: красный, оранжевый, жёлтый, зелёный, голубой и
фиолетовый.
Наше дело правое эээ Мы победим!
"эээ" is not good of course, but that was the only configuration
where xdotool produced english letters that were expected.
I tested russian letters *manually* in every configuration with and
without flyspell-mode but i always got correct results. So i can't say
that i met your problem. It's more likely i faced the bug of xdotool or
some X internals. Whenever i tested "xdotool type <text>" it printed weird
combinations of qwerty and dvorak parts of words in any window, not only
emacs (i also tested it with xterm and conkeror).
Some examples of 'xdotool'-ed text (in any window):
| command | result |
|---------------------------------------+------------------------|
| xdotool type some-text | some-text |
| xdotool type flyspell-mode | yptsrepp-mode |
| xdotool type communication | iommuliiatiol |
| xdotool type "very strange behaviour" | vert stralue behaviour |
These results are the same for "us,dvorak" and "dvorak,us"; as i said
when just "us" layout is used xdotool doesn't distort english words.
Vladimir Lomov (2013-08-14 16:42 +0400):
> 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.
As it happens in tty as well, i think strangeness i faced is not the
same as yours.
P.S. There is a recent similar bug-report:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15151