Subject: Re: bug#68446: 29.1.90; Bidi right-to-left paragraphs missing text in Org mode

From: Eli Zaretskii <[email-masked]>
Date: Sun, 14 Jan 2024 13:24:59 +0200

> From: Thamer Mahmoud <[email-masked]>
> Date: Sun, 14 Jan 2024 13:21:57 +0300
> 
> 1. In emacs -Q, create an empty buffer with Org mode active and type:
> 
> a [[link]]
> 
> 2. Evaluate: (setq bidi-paragraph-direction 'right-to-left)
> 3. Note the "a" and link are no longer visible.

I think it's an Org bug: it should prevent bidi reordering inside the
"[[link]]" string.  For example, wrap the "[[link]]" thing in LRO..PDF
bidi controls.  Because without that, the brackets can be mirrored by
bidi reordering and the BPA algorithm, and the link is no longer in
the form that Org expects.  The result is that the entire text becomes
invisible.

A work-around is to do one of the following:

  . insert one or more L2R characters after the "[[link]]", or
  . set bidi-inhibit-bpa to a non-nil value

I don't see an Emacs bug here, surprising as it may sound.  Lisp
programs that depend on particular sequence of characters on display
should be aware that bidi reordering can affect that.

Adding Ihor to the discussion.