unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: David De La Harpe Golden <david@harpegolden.net>
Cc: emacs-devel@gnu.org
Subject: Re: How to recognize keyboard insertion?
Date: Sat, 31 Oct 2009 19:20:43 +0200	[thread overview]
Message-ID: <83skczcwes.fsf@gnu.org> (raw)
In-Reply-To: <4AEC6CC5.3010009@harpegolden.net>

> Date: Sat, 31 Oct 2009 16:58:45 +0000
> From: David De La Harpe Golden <david@harpegolden.net>
> 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.




  reply	other threads:[~2009-10-31 17:20 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-31 15:57 How to recognize keyboard insertion? Eli Zaretskii
2009-10-31 16:58 ` David De La Harpe Golden
2009-10-31 17:20   ` Eli Zaretskii [this message]
2009-10-31 17:37     ` David De La Harpe Golden
2009-10-31 17:43       ` David De La Harpe Golden
2009-10-31 18:15       ` Eli Zaretskii
2009-10-31 19:26         ` David De La Harpe Golden
2009-10-31 20:01           ` Eli Zaretskii
2009-10-31 20:42             ` David De La Harpe Golden
2009-10-31 21:23               ` Eli Zaretskii
2009-10-31 21:49                 ` David De La Harpe Golden
2009-11-01  3:44                   ` Eli Zaretskii
2009-11-01  5:24                     ` David De La Harpe Golden
2009-11-01 19:59                       ` Eli Zaretskii
2009-11-01 20:19                         ` David De La Harpe Golden
2009-11-01  3:40           ` Stephen J. Turnbull
2009-11-01  5:46             ` David De La Harpe Golden
2009-11-01  5:44         ` tomas
2009-11-01 18:48           ` Eli Zaretskii
2009-11-01 20:09             ` David De La Harpe Golden
2009-11-02  5:03               ` tomas
2009-11-01  1:30     ` Jason Rumney
2009-11-01  4:02       ` Eli Zaretskii
2009-11-01  5:25         ` Stephen J. Turnbull
2009-11-01 13:59           ` David De La Harpe Golden
2009-11-01 19:57           ` Eli Zaretskii
     [not found]     ` <837huac8gg.fsf@gnu.org>
2009-11-02 14:49       ` Ehud Karni
2009-11-02 19:02         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83skczcwes.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=david@harpegolden.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).