all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: 44076@debbugs.gnu.org, joostkremers@fastmail.fm
Subject: bug#44076: 27.1.50; Weird display effect with RTL text in lists
Date: Mon, 19 Oct 2020 11:00:43 +0300	[thread overview]
Message-ID: <4A4D04AF-60BF-4820-8FFB-FF091A1D5575@gnu.org> (raw)
In-Reply-To: <87y2k2wtou.fsf@fastmail.fm>

On October 19, 2020 10:39:29 AM GMT+03:00, Joost Kremers <joostkremers@fastmail.fm> wrote:
> 
> In an IELM buffer:
> 
> ```
> *** Welcome to IELM ***  Type (describe-mode) for help.
> ELISP> (setq mylist nil)
> nil
> 
> ELISP> (push "2nd-place clitics" mylist)
> ("2nd-place clitics")
> 
> ELISP> (push "صباح الخير" mylist)
> ("صباح الخير" "2nd-place clitics")
> 
> ELISP> (cl-first mylist) 
> "صباح الخير"
> 
> ELISP> (cl-second mylist)
> "2nd-place clitics"
> ```
> 
> The contents of the list is correct, but it is displayed incorrectly,
> as shown.
> This is not dependent on IELM, it also happens in the `*scratch*`
> buffer or in
> the echo area when evaluating `mylist`. The problem does not occur if
> the second
> element in the list does not start with a number.
> 
> I used Arabic in the example, but Hebrew shows the same problem. 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. The problem occurs in either case.

The display is correct according to the rules of the UBA, the Unicode Bidirectilnal Algorithm, which mandates how mixed RTL and LTR text should be reordered for display.  As you see, the result can be confusing when structured text is rendered as if it were a single plain-text string.

Emacs has capabilities to do better, so if we are willing to invest efforts in this direction, I can suggest a couple of possible solutions, which will have to do with using Unicode control characters around rhe textual representation of Lisp data.





      parent reply	other threads:[~2020-10-19  8:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19  7:39 bug#44076: 27.1.50; Weird display effect with RTL text in lists Joost Kremers
2020-10-19  7:57 ` Andreas Schwab
2020-10-19  8:16   ` Eli Zaretskii
2020-10-19  8:00 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A4D04AF-60BF-4820-8FFB-FF091A1D5575@gnu.org \
    --to=eliz@gnu.org \
    --cc=44076@debbugs.gnu.org \
    --cc=joostkremers@fastmail.fm \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.