From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to recognize keyboard insertion? Date: Sat, 31 Oct 2009 19:20:43 +0200 Message-ID: <83skczcwes.fsf@gnu.org> References: <83vdhvd096.fsf@gnu.org> <4AEC6CC5.3010009@harpegolden.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1257009724 27652 80.91.229.12 (31 Oct 2009 17:22:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 Oct 2009 17:22:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: David De La Harpe Golden Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 31 18:21:57 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N4HeG-0007We-PX for ged-emacs-devel@m.gmane.org; Sat, 31 Oct 2009 18:21:57 +0100 Original-Received: from localhost ([127.0.0.1]:49055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4HeA-0000jZ-T4 for ged-emacs-devel@m.gmane.org; Sat, 31 Oct 2009 13:21:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N4He5-0000jN-0z for emacs-devel@gnu.org; Sat, 31 Oct 2009 13:21:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N4He0-0000iu-Ks for emacs-devel@gnu.org; Sat, 31 Oct 2009 13:21:44 -0400 Original-Received: from [199.232.76.173] (port=35194 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4He0-0000ir-Em for emacs-devel@gnu.org; Sat, 31 Oct 2009 13:21:40 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:39964) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N4Hdz-0007cw-UL for emacs-devel@gnu.org; Sat, 31 Oct 2009 13:21:40 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0KSE009002MCO000@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 31 Oct 2009 19:20:43 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.70.37.193]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KSE007VQ2UI6C80@a-mtaout20.012.net.il>; Sat, 31 Oct 2009 19:20:43 +0200 (IST) In-reply-to: <4AEC6CC5.3010009@harpegolden.net> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116517 Archived-At: > Date: Sat, 31 Oct 2009 16:58:45 +0000 > From: David De La Harpe Golden > Cc: emacs-devel@gnu.org > > Do you? I'm not really knowledgeable about RtL, but reason I ask is > because when I switch on an arabic OS-level keyboard layout, Shift-9 > actually generates a ) parenright keysym and shift-0 a ( parenleft, > which I think is then displayed mirrored as per the last bit of your > post in RtL contexts. But that is wrong: per the Unicode Bidirectional Algorithm (a.k.a. UAX#9), a `(' should only be mirrored if its resolved directionality is R: L4. A character is depicted by a mirrored glyph if and only if (a) the resolved directionality of that character is R, and (b) the Bidi_Mirrored property value of that character is true. To simplify, this means that a `(' should be mirrored when surrounded by strong R2L characters, but not when surrounded by Latin characters or European digits. What you describe above means that, when typing mixed Arabic and Latin text, the user needs to switch back from Arabic when she types mirrored characters, even if these characters are surrounded by digits, for example. In Emacs, this means that we would need to switch away from the input method, even when typing characters whose keys are not translated by the input method. That sounds like a nuisance. Alternatively, we will need to mirror characters even if their directionality is L, which is against UAX#9 and will cause incorrect display in some not-so-rare cases. For example, try typing "9*(4+5)" after switching to Arabic keyboard. What do you get? > So the right place to do such keyboard mirroring intra-emacs might be > in quail, i.e. for when people are trying to work RtL only intra-emacs > still with a western os-level keymap. Quail cannot easily know the context: it can only mirror these characters always, which is not right, since the display will mirror them only if they are surrounded by strong R2L characters.