From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: How to recognize keyboard insertion? Date: Sun, 01 Nov 2009 09:30:35 +0800 Message-ID: <4AECE4BB.9010900@gnu.org> References: <83vdhvd096.fsf@gnu.org> <4AEC6CC5.3010009@harpegolden.net> <83skczcwes.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1257039064 2978 80.91.229.12 (1 Nov 2009 01:31:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Nov 2009 01:31:04 +0000 (UTC) Cc: emacs-devel@gnu.org, David De La Harpe Golden To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 01 02:30: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 1N4PHT-0005gV-SS for ged-emacs-devel@m.gmane.org; Sun, 01 Nov 2009 02:30:56 +0100 Original-Received: from localhost ([127.0.0.1]:40609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4PHT-0005Bn-2d for ged-emacs-devel@m.gmane.org; Sat, 31 Oct 2009 21:30:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N4PHN-0005Ba-P1 for emacs-devel@gnu.org; Sat, 31 Oct 2009 21:30:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N4PHJ-0005AL-6U for emacs-devel@gnu.org; Sat, 31 Oct 2009 21:30:49 -0400 Original-Received: from [199.232.76.173] (port=50565 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4PHJ-0005AB-1T for emacs-devel@gnu.org; Sat, 31 Oct 2009 21:30:45 -0400 Original-Received: from mail-yx0-f191.google.com ([209.85.210.191]:49308) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N4PHH-0005TD-QT; Sat, 31 Oct 2009 21:30:43 -0400 Original-Received: by yxe29 with SMTP id 29so3837720yxe.14 for ; Sat, 31 Oct 2009 18:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:message-id :date:from:user-agent:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=gvDUaJaaM2E1ccAJGVZiuKdZje0SNIFpsZrIBjofRyQ=; b=NKN9LuqphrneApLOS2ao4OMp0NfeWeKtIIL6OOoJooyZmrZwqdktLhAsK076mQryP8 buRXvXupmGXrYgPSulURn4YJ+RCE7adXLS+fnJaLJpWKyzKINx1MbU3u971xu/un3CTi o9iu9T+59DufEFAvbV/kp3BVz/Cme9xizbFgQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=LIm6v4ROOBtZcOaFxiwmD+G/Ibgl3j/zuYYkFUNoejc6FYwGB6xtWsRvEGn4jbfXiH yUqB/GJANf5087Zc6tx6CN4K37Ugx1mwXNH4svZ4HYU7/17eLK2Ap1SlfILo2sqa3s2/ OIiucf4vAPnvh+qYdC96o9jGudHcAEztWTUUY= Original-Received: by 10.90.159.16 with SMTP id h16mr7280037age.24.1257039041740; Sat, 31 Oct 2009 18:30:41 -0700 (PDT) Original-Received: from wanchan.jasonrumney.net ([118.100.163.63]) by mx.google.com with ESMTPS id 5sm1983107yxg.64.2009.10.31.18.30.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 31 Oct 2009 18:30:40 -0700 (PDT) Original-Received: from wanchan.jasonrumney.net (localhost [127.0.0.1]) by wanchan.jasonrumney.net (Postfix) with ESMTP id 9C049E3; Sun, 1 Nov 2009 09:30:35 +0800 (MYT) User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) In-Reply-To: <83skczcwes.fsf@gnu.org> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:116539 Archived-At: Eli Zaretskii wrote: > 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: > I don't think you can do that mirroring on input, as the directionality will change as the user types (Assume below letters represent an Arabic or Hebrew character): User types: ABCD( Displayed as: )DCBA User types: ABCD(4 Displayed as: 4)DCBA or (4DCBA? I suspect the first, as the user might type something other than a number next User types: ABCD(4+5) Displayed as: (4+5)DCBA regardless of how directionality of parens is interpreted. User types: ABCD(4+5)*9 Displayed as: (4+5)*9DCBA Parens here must be LTR I guess this is why the mirroring happens at keyboard driver level and applications do not try to do it correctly, because in practice doing it correctly results in text jumping around, confusing the user more than it confuses them to manually fix the problems of a dumb implementation. And there are always going to be ambiguous cases, where leaving the user to manually DTRT will be the only option.