emacs-bidi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs-bidi] Bidirectional editing in Emacs -- main design decisions


From: Eli Zaretskii
Subject: Re: [emacs-bidi] Bidirectional editing in Emacs -- main design decisions
Date: Thu, 19 May 2016 07:46:35 +0300

> Date: Wed, 18 May 2016 13:56:22 -0700 (MST)
> From: mhsekhavat <address@hidden>
> 
>  Eli Zaretskii wrote
>  What is the real-life use case that requires this? What kind of text are we 
> talking about? 
> 
> The two use cases are: 
> 
> 1) Manipulating serialized file formats such as: 
> 
> * A yaml file can have a list of strings each of which may be left-to-right 
> or right-to-left. such as: 
> 
> full_names:
>     - Carolyn Simon
>     - Elijah  Moreno
>     - An Arabic Full Name Which Should Be Displayed right-to-left
> date : 2001-01-23
> * A SubRip subtitle file such as: 
> 
> 1
> 00:20:41,150 --> 00:20:45,109
> - English speaker: what is your name?
> - &lt An Arabic name which should be displayed right-to-left &gt
> 
> 2
> 00:21:41,150 --> 00:22:45,109
> - Nice to meet you

In each of these examples, either there's no problem having the text
displayed in a L2R paragraph (it still gets reordered correctly), or
you can start the line with a RLM character to see better results in
some cases.

> 2) When writing a LaTeX text, you can split a paragraph into many lines. For 
> example, if you want to write A
> Latin paragraph with an Arabic sentence in it , it is very common to write 
> the Arabic sentence in a separated
> line: 
> 
> 
> This is an Latin paragraph with some 
> \begin{Arabic}
> بسم الله الرحمن الرحیم
> \end{Arabic}
> that is added.
> This will be rendered in a simple paragraph by LaTeX, and most editors like 
> gedit, TexStudio, TexMaker,...
> display it correctly (all lines LTR direction but Arabic line in RTL 
> direction). But emacs does not display the
> Arabic sentence in correct direction. 

TeX file is not a simple text file (similar to HTML).  Supporting
correct bidi reordering in such structured meta-text files is a
feature that is missing. You cannot fix this by just setting paragraph
direction.  Once again, you can sometimes alleviate the problem by
using LRM and RLM characters.

> As I have previously mentioned, this behavior is a nice feature for emacs 
> when editing regular text files, But I
> think it is necessary to be able to turn it off when manipulating a file 
> format in which this feature is more like a
> bug, and inconsistency with most other standard editors. 

Emacs currently doesn't support this.  Patches are welcome.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]