emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to recognize keyboard insertion?


From: Jason Rumney
Subject: Re: How to recognize keyboard insertion?
Date: Sun, 01 Nov 2009 09:30:35 +0800
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]