[Top][All Lists]

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

Re: How to recognize keyboard insertion?

From: Eli Zaretskii
Subject: Re: How to recognize keyboard insertion?
Date: Sat, 31 Oct 2009 19:20:43 +0200

> Date: Sat, 31 Oct 2009 16:58:45 +0000
> From: David De La Harpe Golden <address@hidden>
> Cc: address@hidden
> 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

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.

reply via email to

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