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-display-reordering is now non-nil by default Date: Thu, 25 Aug 2011 09:12:18 +0300 Message-ID: <83d3fuggu5.fsf@gnu.org> References: <4E48D309.6050503@acdlabs.ru> <83hb5jujjs.fsf@gnu.org> <874o1j10zv.fsf@fencepost.gnu.org> <8362lyvcli.fsf@gnu.org> <83k4aasnm9.fsf@gnu.org> <838vqmx9tj.fsf@gnu.org> <83ei0cimdl.fsf@gnu.org> <831uwchrvw.fsf@gnu.org> <83wre3gp2h.fsf@gnu.org> <83r54ahhpr.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1314252780 17373 80.91.229.12 (25 Aug 2011 06:13:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2011 06:13:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 25 08:12:56 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QwTBP-00089X-E4 for ged-emacs-devel@m.gmane.org; Thu, 25 Aug 2011 08:12:55 +0200 Original-Received: from localhost ([::1]:36858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTBO-00069L-FL for ged-emacs-devel@m.gmane.org; Thu, 25 Aug 2011 02:12:54 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTBM-00069F-0Z for emacs-devel@gnu.org; Thu, 25 Aug 2011 02:12:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwTBK-0006ZG-O9 for emacs-devel@gnu.org; Thu, 25 Aug 2011 02:12:51 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:41488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTBK-0006Z2-Hj for emacs-devel@gnu.org; Thu, 25 Aug 2011 02:12:50 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LQG00000ZTAW900@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Thu, 25 Aug 2011 09:12:16 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.21.112]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LQG000Y1ZWETO40@a-mtaout23.012.net.il>; Thu, 25 Aug 2011 09:12:15 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.175 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:143573 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Thu, 25 Aug 2011 00:38:51 -0400 >=20 > But I think I now understand the problem you're talking about: > ABCD! all on its own would be properly displayed as !DCBA, but if i= t is > followed by an LRM mark then it will turn into DCBA!. So, yes, tha= t's > a problem. What about adding a TAB instead of an LRM? Won't help, you need an RLM after the exclam. Or enclose the entire string in RLE..PDF, see below. > > emacs -Q > > M-: (read-buffer "Buffer name: " "=D7=90=D7=91=D7=92=D7=93=D7= =94") RET > > M-n >=20 > Right. This is one more example of a "field". I think we'd want > a function like bidi-independent-string which takes a string STR an= d > returns a new string that displays just like STR does but with the = added > twist that none of the surrounding text will ever get displayed in = the > middle of STR and that text that comes after STR gets displayed "af= ter" > and text that comes before gets displayed "before". > I'm not sure if that is possible or even meaningful, tho. It's possible. It's called "embedding". Here (watch the directional control characters around the parentheses): Buffer name =E2=80=AA(default "=D7=90=D7=91=D7=92=D7=93=D7=94"):= =E2=80=AC =D7=90=D7=91=D7=92=D7=93=D7=A8=D7=A9=D7=AA123 Should we provide bidi-embed-string-l2r/r2l functions? > >> E.g. I think that a buffer ABC<1> should be either displayed as = CBA<1> > >> or <1>CBA depending on the surrounding text direction (which mig= ht be > >> different from the paragraph direction). > > If not, what do you mean by "surrounding text direction"? >=20 > Whether this ABC<1> appears within an L2R chunk of text or an L2R c= hunk > of text. I guess that "paragraph direction" is a good approximatio= n. Why not always display it is <1>CBA ? That's the natural visual order.