From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Kost Newsgroups: gmane.emacs.help Subject: Re: Weirdness with Input Method/quail : how to figure out source of it? Date: Thu, 22 Aug 2013 18:58:10 +0400 Message-ID: <87eh9l3h8d.fsf@gmail.com> References: <20130814124238.GA722@smoon> <8738qasm9t.fsf@gmail.com> <20130815231908.GB722@smoon> <8761v6kuxk.fsf@gmail.com> <20130816073150.GC722@smoon> <87wqnlkgsa.fsf@gmail.com> <20130820083318.GA804@smoon> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1377183533 14781 80.91.229.3 (22 Aug 2013 14:58:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Aug 2013 14:58:53 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Vladimir Lomov Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 22 16:58:54 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VCWLV-0004Lq-EA for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Aug 2013 16:58:45 +0200 Original-Received: from localhost ([::1]:60303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCWLV-0004kW-4V for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Aug 2013 10:58:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCWLC-0004kF-Un for help-gnu-emacs@gnu.org; Thu, 22 Aug 2013 10:58:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCWL5-000854-8A for help-gnu-emacs@gnu.org; Thu, 22 Aug 2013 10:58:26 -0400 Original-Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]:60747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCWL4-00084L-U5 for help-gnu-emacs@gnu.org; Thu, 22 Aug 2013 10:58:19 -0400 Original-Received: by mail-la0-f50.google.com with SMTP id ek20so1474289lab.23 for ; Thu, 22 Aug 2013 07:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=f7YHOFkNS3QKeg3qPhCm09z+eCZROtbYee/aYRMVjOw=; b=mTGgFo4aPX+2BeprKeNeMBBNa4Y4UTwCP37GVsWeigvbfW4Tzvrp9UuPDVhbO/nieL h2bomwoaqTbP5/0xtXqc7uYZJ3BQZbxtlDfEqLI+y09LeH3/jhMWTai0hdQKx7GiwaBP 1Z62Li1Vu23phoC1atqej1fnG1LSPxfhRvrbcXStZMmh6iQDTuDXRaq4kD0yW4O+eGHl 25W/pGrkLJ7nwEVRsH4OXJvD77Wdz9+paag2+b3WggafhxLWqq2JDE1TjBKf8GLiWlBb 4u9OmEgoPqeoCgK22lfzjfUNW+cQKjSwBuOQtfdGuxIuHekGJntb23N/hNn4yYKv/yYG Qlbw== X-Received: by 10.152.44.225 with SMTP id h1mr11216873lam.15.1377183497274; Thu, 22 Aug 2013 07:58:17 -0700 (PDT) Original-Received: from leviafan (128-70-198-98.broadband.corbina.ru. [128.70.198.98]) by mx.google.com with ESMTPSA id f17sm5138537lbo.12.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 22 Aug 2013 07:58:16 -0700 (PDT) In-Reply-To: <20130820083318.GA804@smoon> (Vladimir Lomov's message of "Tue, 20 Aug 2013 17:33:18 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::232 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93051 Archived-At: 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 de= fault-input-method "russian-computer")' --eval '(toggle-input-method)' --ev= al '(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 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: =D0=92=D1=81=D0=B5=D0=BC =D0=B8=D0=B7=D0=B2=D0=B5=D1=81=D1=82=D0=BD=D1=8B = =D1=86=D0=B2=D0=B5=D1=82=D0=B0 =D1=80=D0=B0=D0=B4=D1=83=D0=B3=D0=B8: =D0=BA= =D1=80=D0=B0=D1=81=D0=BD=D1=8B=D0=B9. =D0=BE=D1=80=D0=B0=D0=BD=D0=B6=D0=B5= =D0=B2=D1=8B=D0=B9. =D0=B6=D1=91=D0=BB=D1=82=D1=8B=D0=B9. =D0=B7=D0=B5=D0= =BB=D1=91=D0=BD=D1=8B=D0=B9. =D0=B3=D0=BE=D0=BB=D1=83=D0=B1=D0=BE=D0=B9 =D0= =B8 =D1=84=D0=B8=D0=BE=D0=BB=D0=B5=D1=82=D0=BE=D0=B2=D1=8B=D0=B9. =D0=9D=D0=B0=D1=88=D0=B5 =D0=B4=D0=B5=D0=BB=D0=BE =D0=BF=D1=80=D0=B0=D0=B2= =D0=BE=D0=B5 --- =D0=BC=D1=8B =D0=BF=D0=BE=D0=B1=D0=B5=D0=B4=D0=B8=D0=BC! (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: =D0=92=D1=81=D0=BB=D0=BC =D0=B8=D0=BA=D0=B2=D0=BB=D1=81=D1=82=D0=B5=D1=8B = =D0=B1=D0=B2=D0=BB=D1=82=D0=B0 =D1=80=D0=B0=D0=B7=D0=B2=D0=B0=D0=B8: =D1=89= =D1=80=D0=B0=D1=81=D0=B5=D1=8B=D1=87, =D0=BE=D1=80=D0=B0=D0=B5=D0=B6=D0=BB= =D0=B2=D1=8B=D1=87, =D0=B6=D1=91=D0=BB=D1=82=D1=8B=D1=87, =D0=BA=D0=BB=D0= =BB=D1=91=D0=B5=D1=8B=D1=87, =D0=B0=D0=BE=D0=BB=D0=B2=D0=B1=D0=BE=D1=87 =D0= =B8 =D1=84=D0=B8=D0=BE=D0=BB=D0=BB=D1=82=D0=BE=D0=B2=D1=8B=D1=87. =D0=95=D0=B0=D0=BF=D0=BB =D0=B7=D0=BB=D0=BB=D0=BE =D0=BF=D1=80=D0=B0=D0=B2= =D0=BE=D0=BB =D1=8D=D1=8D=D1=8D =D0=9C=D1=8B =D0=BF=D0=BE=D0=B1=D0=BB=D0=B7= =D0=B8=D0=BC! 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). =D0=92=D1=81=D0=B5=D0=BC =D0=B8=D0=B7=D0=B2=D0=B5=D1=81=D1=82=D0=BD=D1=8B = =D1=86=D0=B2=D0=B5=D1=82=D0=B0 =D1=80=D0=B0=D0=B4=D1=83=D0=B3=D0=B8: =D0=BA= =D1=80=D0=B0=D1=81=D0=BD=D1=8B=D0=B9, =D0=BE=D1=80=D0=B0=D0=BD=D0=B6=D0=B5= =D0=B2=D1=8B=D0=B9, =D0=B6=D1=91=D0=BB=D1=82=D1=8B=D0=B9, =D0=B7=D0=B5=D0= =BB=D1=91=D0=BD=D1=8B=D0=B9, =D0=B3=D0=BE=D0=BB=D1=83=D0=B1=D0=BE=D0=B9 =D0= =B8 =D1=84=D0=B8=D0=BE=D0=BB=D0=B5=D1=82=D0=BE=D0=B2=D1=8B=D0=B9. =D0=9D=D0=B0=D1=88=D0=B5 =D0=B4=D0=B5=D0=BB=D0=BE =D0=BF=D1=80=D0=B0=D0=B2= =D0=BE=D0=B5 =D1=8D=D1=8D=D1=8D =D0=9C=D1=8B =D0=BF=D0=BE=D0=B1=D0=B5=D0=B4= =D0=B8=D0=BC! "=D1=8D=D1=8D=D1=8D" is not good of course, but that was the only config= uration 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 " 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 sp= oradic. It doesn't > depend if I run Emacs with my settings or without any (emacs -Q), in term= inal (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 quic= kly.) 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=3D15151