From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#44076: 27.1.50; Weird display effect with RTL text in lists Date: Mon, 19 Oct 2020 11:00:43 +0300 Message-ID: <4A4D04AF-60BF-4820-8FFB-FF091A1D5575@gnu.org> References: <87y2k2wtou.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32075"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: K-9 Mail for Android To: 44076@debbugs.gnu.org, joostkremers@fastmail.fm Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 19 10:07:55 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kUQCx-0008Fu-88 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 10:07:55 +0200 Original-Received: from localhost ([::1]:58638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUQCw-00046k-75 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 04:07:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUQ6I-0006mH-Vy for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 04:01:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56530) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUQ6I-0002mJ-G4 for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 04:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUQ6I-0002eg-F3 for bug-gnu-emacs@gnu.org; Mon, 19 Oct 2020 04:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Oct 2020 08:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44076 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, Joost Kremers , 44076@debbugs.gnu.org Original-Received: via spool by 44076-submit@debbugs.gnu.org id=B44076.160309445810180 (code B ref 44076); Mon, 19 Oct 2020 08:01:02 +0000 Original-Received: (at 44076) by debbugs.gnu.org; 19 Oct 2020 08:00:58 +0000 Original-Received: from localhost ([127.0.0.1]:39842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUQ6E-0002e7-Go for submit@debbugs.gnu.org; Mon, 19 Oct 2020 04:00:58 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUQ6C-0002dg-6k for 44076@debbugs.gnu.org; Mon, 19 Oct 2020 04:00:56 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58042) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUQ66-0002d8-Rt; Mon, 19 Oct 2020 04:00:50 -0400 Original-Received: from [2a02:14f:1ff:2de5::a57d:702f] (port=34960) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1kUQ65-0000gx-Lc; Mon, 19 Oct 2020 04:00:50 -0400 In-Reply-To: <87y2k2wtou.fsf@fastmail.fm> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190951 Archived-At: On October 19, 2020 10:39:29 AM GMT+03:00, Joost Kremers wrote: >=20 > In an IELM buffer: >=20 > ``` > *** Welcome to IELM *** Type (describe-mode) for help=2E > ELISP> (setq mylist nil) > nil >=20 > ELISP> (push "2nd-place clitics" mylist) > ("2nd-place clitics") >=20 > ELISP> (push "=D8=B5=D8=A8=D8=A7=D8=AD =D8=A7=D9=84=D8=AE=D9=8A=D8=B1" m= ylist) > ("=D8=B5=D8=A8=D8=A7=D8=AD =D8=A7=D9=84=D8=AE=D9=8A=D8=B1" "2nd-place cl= itics") >=20 > ELISP> (cl-first mylist)=20 > "=D8=B5=D8=A8=D8=A7=D8=AD =D8=A7=D9=84=D8=AE=D9=8A=D8=B1" >=20 > ELISP> (cl-second mylist) > "2nd-place clitics" > ``` >=20 > The contents of the list is correct, but it is displayed incorrectly, > as shown=2E > This is not dependent on IELM, it also happens in the `*scratch*` > buffer or in > the echo area when evaluating `mylist`=2E The problem does not occur if > the second > element in the list does not start with a number=2E >=20 > I used Arabic in the example, but Hebrew shows the same problem=2E The > font is > also not the issue: the above interaction is from `emacs -Q`, which > uses a > different font for Arabic (and Hebrew) on my system than when I use my > full > config=2E The problem occurs in either case=2E The display is correct according to the rules of the UBA, the Unicode Bidi= rectilnal Algorithm, which mandates how mixed RTL and LTR text should be re= ordered for display=2E As you see, the result can be confusing when struct= ured text is rendered as if it were a single plain-text string=2E Emacs has capabilities to do better, so if we are willing to invest effort= s in this direction, I can suggest a couple of possible solutions, which wi= ll have to do with using Unicode control characters around rhe textual repr= esentation of Lisp data=2E