From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel,gmane.emacs.bidi Subject: Re: [emacs-bidi] Mixed L2R and R2L paragraphs and horizontal scroll Date: Wed, 03 Feb 2010 20:59:13 +0200 Message-ID: <83eil2gn7i.fsf@gnu.org> References: <83tyu3iu6b.fsf@gnu.org> <201002011400.o11E0jMQ007420@beta.mvs.co.il> <83vdeghfqg.fsf@gnu.org> <201002012205.o11M5Sci011809@beta.mvs.co.il> <83k4uvh09o.fsf@gnu.org> <201002031310.o13DAqXd019253@beta.mvs.co.il> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1265223569 1844 80.91.229.12 (3 Feb 2010 18:59:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Feb 2010 18:59:29 +0000 (UTC) Cc: emacs-bidi@gnu.org, emacs-devel@gnu.org To: ehud@unix.mvs.co.il Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 03 19:59:26 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NckRh-0007cM-OJ for ged-emacs-devel@m.gmane.org; Wed, 03 Feb 2010 19:59:26 +0100 Original-Received: from localhost ([127.0.0.1]:39926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NckRh-0000uJ-4R for ged-emacs-devel@m.gmane.org; Wed, 03 Feb 2010 13:59:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NckRW-0000qI-DO for emacs-devel@gnu.org; Wed, 03 Feb 2010 13:59:14 -0500 Original-Received: from [199.232.76.173] (port=45440 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NckRV-0000pQ-H5 for emacs-devel@gnu.org; Wed, 03 Feb 2010 13:59:13 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NckRT-00039w-Ih for emacs-devel@gnu.org; Wed, 03 Feb 2010 13:59:13 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:64139) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NckRP-000393-9m; Wed, 03 Feb 2010 13:59:07 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0KXA003004NWSA00@a-mtaout20.012.net.il>; Wed, 03 Feb 2010 20:59:05 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.70.67.249]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KXA0033N4QFTR00@a-mtaout20.012.net.il>; Wed, 03 Feb 2010 20:59:05 +0200 (IST) In-reply-to: <201002031310.o13DAqXd019253@beta.mvs.co.il> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:120869 gmane.emacs.bidi:507 Archived-At: > Date: Wed, 3 Feb 2010 15:10:52 +0200 > From: "Ehud Karni" > Cc: emacs-bidi@gnu.org, emacs-devel@gnu.org > > On Tue, 02 Feb 2010 22:04:51 Eli Zaretskii wrote: > > > > So let me tell directly and unequivocally what I propose. There are > > two main principles: > > > > . Line truncation and continuation is done in the visual order > > > > . Horizontal scrolling is done in the logical order > > What you describe here is the Emacs screen as rectangle frame moving > over the visual ordered text. For truncation and continuation, yes. For horizontal scrolling, no: it works in the logical order. That is, scroll-left moves text in each line towards its respective margin: left margin for L2R lines, right margin for R2L. More about this near the end of this message. > No word processor that uses that approach (check open-office with a > long enough text, or with the other OS word processor). I didn't try OpenOffice, but that "other OS word processor" does it exactly like I described, at least with truncation (it does not have the equivalent of continuation lines, AFAICS). Maybe you are talking about how lines are re-flowed by these word processors. If so, the Emacs equivalent is fill-paragraph, or the various packages (like longlines) that do it automatically for you. When a line is filled, a newline is inserted, and then the order of the text spread between several lines is what you expect: > > What this means is that an L2R line that ends with a stretch of R2L > > text will be continued as follows: > > > > +-------------------------------+ > > |name2 1234 catag2 NOITPIRCSED-\| > > |GNOL-YREV | > > +-------------------------------+ > > See the problem - the user must start reading from the second line. Right. If you want to read it correctly, use fill-paragraph. Then this will display as +-------------------------------+ |name2 1234 catag2 -GNOL-YREV | |NOITPIRCSED | +-------------------------------+ (That's because bidi reordering stops at the newline and restarts anew after it.) > > Similarly, an R2L line will be continued like this: > > > > +-------------------------------+ > > |/RCSED-GNOL-YREV-YREV-YREV-YREV| > > | NOITPI| > > +-------------------------------+ > > > > and truncated like this: > > > > +-------------------------------+ > > |$RCSED-GNOL-YREV-YREV-YREV-YREV| > > +-------------------------------+ > > This is the correct way. The truncation and continuation will always be ``correct'' in L2R lines with only left to right text, and in R2L lines with only right-to-left text. The ``problem'' happens only in mixed lines, and then when the line is truncated or continued in the middle of a run of text whose direction is the opposite of the line direction (actually, of the base paragraph direction). > The logical text is "some latin text followed by HEBREW VERY1 VERY2 > LONG TEXT FOR DEMONSTRATING OF THE DIFFERENT SCROLLING OPTIONS AND > THE UNNATURAL RESULT OF ELIS APPROACH WITH small latin tail" > > With your approach it will appear as (first, wider screen): > > +----------------------------------------+ > |some latin text followed by HTIW HCAORP$| > |PA SILE FO TLUSER LARUTANNU EHT DNA SNO$| > |ITPO GNILLORCS TNEREFFID EHT FO GNITART$| > |SNOMED ROF TXET GNOL 2YREV 1YREV WERBEH$| > | small latin tail | > +----------------------------------------+ > > The Hebrew starts at 4th visual lines and goes upward. No, this is some kind of misunderstanding, because there can be no such display, not with the truncation glyphs. Is the logical text just a single line? If so, the display will be like this: +----------------------------------------+ |some latin text followed by HTIW HCAORP\| |PA SILE FO TLUSER LARUTANNU EHT DNA SNO\| |ITPO GNILLORCS TNEREFFID EHT FO GNITART\| |SNOMED ROF TXET GNOL 2YREV 1YREV WERBEH\| | small latin tail | +----------------------------------------+ And yes, the R2L text reads bottom to top. But rewriting the central piece of the display engine to make this use-case look better is beyond my resources. There's a lot of more important (IMO) issues to take care of. If this will really annoy users (and we won't know until bidi Emacs hits the FTP sites, because these features are unique to Emacs), someone else will have to come and do the surgery it takes, sorry. > with smaller screen (assume only 7 lines long): > > +--------------------+ > |some latin text fol$| > |lowed by HTIW HCAOR$| > |PPA SILE FO TLUSER $| > |LARUTANNU EHT DNA S$| > |NOITPO GNILLORCS TN$| > |EREFFID EHT FO GNIT$| > |ARTSNOMED ROF TXET $| > +--------------------+ Again, I think you meant \ for continuation lines, not $ for truncation. > Oops, the beginning of the Hebrew text disappeared. And this is significantly worse than if the _end_ of the text disappears, because...? > +--------------------+ > |$ 2YREV 1YREV WERBEH| > |$NOMED ROF TXET GNOL| > |$FID EHT FO GNITARTS| > |$PO GNILLORCS TNEREF| > |$TANNU EHT DNA SNOIT| > |$SILE FO TLUSER LARU| > |$???? HTIW HCAORPPA | > +--------------------+ > The last line ???? are "tail" by Eli's way and "smal" by my way. Yes, but that continuation glyph should tell me and you that there's more text out of view. > I claim the scrolling should follow the "same" rules. > e.g. 1: wide screen scrolled 20 (half width): > +----------------------------------------+ > |$owd by OF TXET GNOL 2YREV 1YREV WERBEH$| > +----------------------------------------+ That's not the same rules applied to scrolling, that's exactly the same situation of truncating a mixed L2R/R2L text as you described above. The issue with scrolling was when you have _two_ different paragraphs, one with left-to-right base direction, the other with right-to-left. Like this: +----------------------------------------+ |some latin text | | | | TXET WERBEH EMOS| +----------------------------------------+ (The empty line in between causes the last line to start a new paragraph.) The issue I raised was what should happen if I now type "C-u 2 C-x <". My conclusion from this discussion (and thanks to all who contributed) is that the resulting display should be this: +----------------------------------------+ |$e latin text | | | | TXET WERBEH E$| +----------------------------------------+ That is, each line scrolls towards its logical-order beginning. "Logically-left", so to say. (Hmm, does it mean "COPYLEFT" will be displayed as "THGIRYPOC"? That's _really_ bad, isn't it?)