From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Line wrap reconsidered Date: Fri, 19 Jun 2020 14:03:24 -0400 Message-ID: <2F9680C4-11D8-4092-A485-2590AAF62CC9@gmail.com> References: <92FF4412-04FB-4521-B6CE-52B08526E4E5@gmail.com> <878shfsq35.fsf@gnus.org> <83imgivjak.fsf@gnu.org> <83lfletr03.fsf@gnu.org> <4895C6EE-5E1F-44BF-93C1-CC5F7C096F73@gmail.com> <9766BA3D-B8F9-456B-9F59-60D21B86E390@gmail.com> <83sgfls2ul.fsf@gnu.org> <83v9kgq6jy.fsf@gnu.org> <5E75D1E2-8BFF-45DA-A643-40DBD5784508@gmail.com> <83r1v3qlel.fsf@gnu.org> <83blm6lzj3.fsf@gnu.org> <83pnakj8fs.fsf@gnu.org> <83k10sj60l.fsf@gnu.org> <0B30F8C8-9B8F-4FCB-B9FB-1B5A0E993CDB@gmail.com> <838sgjzij2.fsf@gnu.org> <83sgerxmbs.fsf@gnu.org> <83bllfx80g.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="29955"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 19 20:05:10 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmLO1-0007E3-Jz for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Jun 2020 20:05:09 +0200 Original-Received: from localhost ([::1]:35474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmLNf-00058a-DG for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Jun 2020 14:04:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmLMP-00048K-Rh for emacs-devel@gnu.org; Fri, 19 Jun 2020 14:03:29 -0400 Original-Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]:34620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jmLMO-0005PM-5z; Fri, 19 Jun 2020 14:03:29 -0400 Original-Received: by mail-qk1-x72c.google.com with SMTP id f18so9826389qkh.1; Fri, 19 Jun 2020 11:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vtQoVqYRuxir53cjP6tTvVJqKt7l4V9HsSmPIowrWOo=; b=ImTBI5D/cvattYmZSl+vsaS+08TS2mK99ykOpFpMysIqJK1Xd21sIXTvzofm80TFYd 4vuP6emNBxlpJuG8lUubjgVC21VRtY3/TQezNFhgJVNjvFjwgIUywrkeombKC99wOl89 dHvJZmjCnwbkYNXGZ9BCfZMQUOnTs5VO0cEqn9oU5CC4dStWhaZK5GSYyPCGRgxJfc8A mBcBJyVdglkHdRdc+8jT7buQYfDjX/KiGBXqJHXLet1aFsHosUOZS4H9nxKv8ISzL4gn TMPt0/vIt7MF0q+0X38Rix04R7Y0QnGpJBkSkEIpEJUOFfPwbWL/A/Z+RcmLHNxggQwY iNjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vtQoVqYRuxir53cjP6tTvVJqKt7l4V9HsSmPIowrWOo=; b=dvJ2s1i5xvCIHxEgOC69YdeKLvEjyxhZ85AlQwhFdo00Hpak1qoNVx7snlfnAHpmMz eNyX5f1iFd/tqcLIxZXn3m7ySMOGbeOR6JQBzmU3oEzzxrpDCJIMl60sxVKIIRrXXgSi lDrYLT3CfhV8RC/MK9rf6KihuP5bip1SkBLkkivE/huRHSOlJXuUnXpyjraW2m8Oz8Vi G4aJLQ1Fq9FqNYIZg9y77pgTsHE9P8FKTk8Y4IqrK0FNfeketfhbcL3p+6cPcZxSYHrz i9BDaZs2hxPyB1B8rTrbJpgklY1GbVcaMIP9hqkG+b2wdT+SeaI83LlSlLXgbgVRUl2L k7RA== X-Gm-Message-State: AOAM530/nStHFTkD7/bsROG8uua8l+8sV6pLZvGRr8XZp8Peq57N4K7s 1c3KG2/ejXaM3lnUDeY60fnAHpmm2kntyA== X-Google-Smtp-Source: ABdhPJx/9Det+6Efw3ymhGvnyoJCDrV9832UxMi+aqn5kkeagxnrQwhdvx9i62/e2wIP/G8jhqzl+g== X-Received: by 2002:a37:668d:: with SMTP id a135mr4542762qkc.131.1592589806530; Fri, 19 Jun 2020 11:03:26 -0700 (PDT) Original-Received: from ?IPv6:2601:98a:4200:9210:f9:e10f:5b2e:903c? ([2601:98a:4200:9210:f9:e10f:5b2e:903c]) by smtp.gmail.com with ESMTPSA id b4sm6216717qka.133.2020.06.19.11.03.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jun 2020 11:03:25 -0700 (PDT) In-Reply-To: <83bllfx80g.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.80.23.2.2) Received-SPF: pass client-ip=2607:f8b0:4864:20::72c; envelope-from=casouri@gmail.com; helo=mail-qk1-x72c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252387 Archived-At: > On Jun 19, 2020, at 1:47 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Fri, 19 Jun 2020 13:22:18 -0400 >> Cc: Lars Ingebrigtsen , >> emacs-devel@gnu.org >>=20 >>> What do you mean by "in the RTL context"? >>>=20 >>> Remember: bidi reordering can take place in two different = situations: >>> then the paragraph direction is left-to-right, and when it's >>> right-to-left. In the former situation, the lines begin on the = left, >>> in the latter they begin on the right. But LTR text, such as CJK >>> characters, will always be rendered left-to-right, no matter what is >>> the paragraph direction. >>>=20 >>> So which "RTL context" did you mean here? >>=20 >> Oooh so there are four cases: LRT text in LTR paragraph, LRT text in = RTL paragraph, RTL text in RTL paragraph, and RTL text in LTR paragraph. = And the order in which the iterator draws glyphs depends on the = paragraph order (although it doesn=E2=80=99t know it). Am I right? >=20 > You can say that there are 4 cases, yes. But from the iterator POV, > there are only 2: either the text of the same direction as the > paragraph, or of the opposite direction. >=20 >>> =D7=90=D7=91=D7=92=D7=93 =D7=94=D7=95=D7=96=D7=97=D7=98=D7=99=D7=9B=D7= =9A =D7=9C=D7=9E=D7=A0=D7=9F = =E6=88=91=E4=BB=8A=E5=A4=A9=E7=9C=8B=E6=9D=A5=E4=BA=86=E6=9C=AC=E4=B9=A6=EF= =BC=8C=E6=84=9F=E8=A7=89=E6=8C=BA=E6=9C=89=E6=84=8F=E6=80=9D=EF=BC=8C=E5=90= =8D=E5=AD=97=E6=98=AF >>> =E3=80=8A=E9=92=A2=E9=93=81=E6=98=AF=E6=80=8E=E6=A0=B7=E7=82=BC=E6=88=90= =E7=9A=84=E3=80=8B=E3=80=82 >=20 >>>=20 >>> (I assume you are reading your email in Emacs; if not, copy/paste = this >>> text into an Emacs buffer whose bidi-paragraph-direction is nil, and >>> look at the resulting display.) >>>=20 >>> Does the above look correct, from the Kinsoku POV? This is how LTR >>> CJK text will be displayed in a paragraph with right-to-left base >>> direction. Do you still think something needs to be flipped here? >>=20 >> Kinsoku looks right, yes. However the period (=E2=80=9C=E3=80=82=E2=80=9D= ) seems to be interpreted as RTL text, not sure why. >=20 > That's expected, since the period has a "weak directionality", so at > the end of the paragraph it takes the paragraph direction. >=20 >>> We must use BOL and EOL in their logical-order meanings, otherwise = the >>> result will be utter confusion. In the above example, the EOL >>> character in the first line is =E6=98=AF, and it is not at the left = edge of >>> the line. It is at the logical-order end of the line, i.e. the >>> character after it in the buffer position order is the newline. But >>> if we had RTL characters instead of the CJK text above, the = character >>> at EOL would indeed have been displayed at the left edge of the = line. >>>=20 >>=20 >> I see. However, I suggest to define EOL and BOL (in kinsoku) in terms = of visual edges, instead of the logical order. Because we are using this = information (NOT_AT_BOL, etc) for visual layout. When we are at a window = edge and ask if this character can appear at this edge, we are = interested in the visual aspect rather than the logical order, if you = get what I mean.=20 >=20 > If that works, then fine. >=20 >> BTW, what does it->bidi_p mean exactly? Does it mean = bidi-display-reordering is t, or current paragraph is =E2=80=98right-to-le= ft, or the char at point is RTL, or something else? >=20 > It means bidi reordering is in effect. For displaying buffer text, it > is determined by bidi-display-reordering. >=20 >> Can I know whether I=E2=80=99m at the left edge or the right edge? >=20 > You can, but why do you need to? I don=E2=80=99t have to know if I=E2=80=99m at left or right edge, I = just want to know if the iterator is drawing from right to left or left = to right. What is the right way to know that? Yuan