From: Alex Kost <alezost@gmail.com>
To: Vladimir Lomov <lomov.vl@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Weirdness with Input Method/quail : how to figure out source of it?
Date: Thu, 22 Aug 2013 18:58:10 +0400 [thread overview]
Message-ID: <87eh9l3h8d.fsf@gmail.com> (raw)
In-Reply-To: <20130820083318.GA804@smoon> (Vladimir Lomov's message of "Tue, 20 Aug 2013 17:33:18 +0900")
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
prev parent reply other threads:[~2013-08-22 14:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eh9l3h8d.fsf@gmail.com \
--to=alezost@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=lomov.vl@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.