From: David De La Harpe Golden <david@harpegolden.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: How to recognize keyboard insertion?
Date: Sat, 31 Oct 2009 19:26:02 +0000 [thread overview]
Message-ID: <4AEC8F4A.8070205@harpegolden.net> (raw)
In-Reply-To: <83r5sjctup.fsf@gnu.org>
Eli Zaretskii wrote:
> My understanding is that Shift-9 generates `(' or `)' depending on
> whether the current keyboard is Latin or Arabic, not depending on the
> characters surrounding the parenthesis. All your examples show that
> (and I see the same on my Windows box if I switch the keyboard to
> Hebrew). Do you agree?
Probably - Shift-9 generates parenleft (#x28) or parenright (#x29)
depending on current keyboard layout. #x28 is then displayed as ( in ltr
context, or ) in rtl context.
>
>>> For example, try typing "9*(4+5)" after switching to Arabic keyboard.
>>> What do you get?
>>>
>>
>> 9*)4+5(
>
> Which is wrong, don't you think?
>
It's clearly not a valid arithmetical expression... It is however how
mature bidi capable apps I tried behave, for better or worse. I don't
think this is an area where emacs, bidi latecomer, should diverge from
established practice, especially not by default - rtl-native users
presumably by now expect to press the key labelled ")" to get "(" when
using their native keymap but in an ltr context. Maybe they regard that
as an annoyance, I dunno, or maybe it's a semantic-map feature, since
the same shift-0 keypress still makes an opening paren (modern hebrew
text, at least, seems to sometimes use () in text, not just arithmetic
much like english, at least judging by wikipedia hebrew texts).
But therefore it's not necessary to track whether the character was
entered by keyboard unless you want to provide a further unusual "smart"
layer that doesn't work like typical bidi apps.
>> I suspect an arabic person might type
>>
>> ثثث(5+4)*9ثثث
>>
>> - i.e. hitting ")" first when transcribing "9*(4+5)".
>
> Maybe if the digits are Arabic digits. I don't know enough Arabic to
> judge this example.
Note that western "arabic numerals" vs. eastern arabic numerals is
apparently a matter of font+bidi display (again for better or worse) -
i.e. if I then copy just the expression above from within the rtl string
and paste it into a ltr context, I get:
(5+4)*9
next prev parent reply other threads:[~2009-10-31 19:26 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
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AEC8F4A.8070205@harpegolden.net \
--to=david@harpegolden.net \
--cc=eliz@gnu.org \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.