From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: bidi and shaping problems in describe-input-method Date: Sat, 10 Mar 2012 12:27:28 +0200 Message-ID: <8362eczr73.fsf@gnu.org> References: <87r4x1uptx.fsf@m17n.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1331375255 12374 80.91.229.3 (10 Mar 2012 10:27:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Mar 2012 10:27:35 +0000 (UTC) Cc: list-general@mohsen.1.banan.byname.net, emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 10 11:27:33 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S6JWN-00043y-B1 for ged-emacs-devel@m.gmane.org; Sat, 10 Mar 2012 11:27:31 +0100 Original-Received: from localhost ([::1]:56937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6JWM-0003Mq-HS for ged-emacs-devel@m.gmane.org; Sat, 10 Mar 2012 05:27:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6JWJ-0003Mk-CT for emacs-devel@gnu.org; Sat, 10 Mar 2012 05:27:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6JWG-00014o-Vt for emacs-devel@gnu.org; Sat, 10 Mar 2012 05:27:26 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:61668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6JWG-00014g-MX for emacs-devel@gnu.org; Sat, 10 Mar 2012 05:27:24 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M0N00D00ZHHJS00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Sat, 10 Mar 2012 12:27:22 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.138.42]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M0N00D9YZPJIH20@a-mtaout22.012.net.il>; Sat, 10 Mar 2012 12:27:20 +0200 (IST) In-reply-to: <87r4x1uptx.fsf@m17n.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:148957 Archived-At: > From: Kenichi Handa > Date: Sat, 10 Mar 2012 11:55:54 +0900 > Cc: list-general@mohsen.1.banan.byname.net, emacs-devel@gnu.org >=20 > The function body I wrote is just an idea, not a complete > solution, and of cource checking against L is apparently > a bug. At least we must check against R (and AL). >=20 > > > > Also, `lower' and `upper' could be strings, in which case you= need a > > > > more complex test. > > >=20 > > > We can give (if (string lower) (aref lower 0) lower) to that > > > function. >=20 > > But that doesn't DTRT. Here's an example where it will fail: ".A= ". >=20 > Why? I was explaining why testing for L is not TRT. > ... | LU | LU | ... >=20 > What we want is to display the left LU to the left of the > right LU, and display each L (character or string) to the > right of the corresponding U. >=20 > Even if the L (of the left LU) is ".A", we don't need LRM > for it. We have to insert LRM only before a character that > may reorder the previous characters, and after a character that > may reorder the following character. Isn't it right? You are describing what bidi-string-mark-left-to-right does, I believe. Note that it will still insert LRM in some cases where it i= s not strictly needed. > > I tried also a different solution: enclose each row of the keyboa= rd > > layout in an L2R override embedding, LRO..PDF. This inserts only= 2 > > control characters per row, and doesn't insert them inside the > > keyboard cells, so it is cleaner, I think. But using this means = that > > no key description in the layout can be a string that requires > > reordering individually. (By contrast, inserting an LRM between = the > > lower and the upper key still allows each description to be > > reordered.) Can we live with such a restriction? I don't know e= nough > > about Quail to tell. >=20 > As it's possible to assign a string to a key, there will be > the case that the characters in the string must be > reordered. In the above case, if L is a hebrew "=D7=A9=D7=9C=D7= =95=D7=9D", it > must be reordered. But, even if we surround that word with > LRE and PDF, the word itself is reordered correctly, right? Yes. But surrounding each `lower' and `upper' key labels in the layout with LRE..PDF inserts even more bidirectional control characters than just inserting LRM. By contrast, using LRO..PDF around the whole row of keys inserts just 2 such characters, so if it were not for the need to reorder the individual key labels, LRO..PDF would be a better alternative. I mentioned it because it does exactl= y what you originally asked for: it effectively disables bidi-display-reordering inside the embedded text, while still leaving the rest of the buffer reordered as usual.