emacs-bidi
[Top][All Lists]
Advanced

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

Re: [emacs-bidi] reordering based on implicit levels


From: Eli Zaretskii
Subject: Re: [emacs-bidi] reordering based on implicit levels
Date: Mon, 12 Nov 2001 11:22:21 +0200 (IST)

On Mon, 12 Nov 2001, Alex Schroeder wrote:

> It seems that the default operation will fail if the string is mostly
> R2L.  The lines will be reversed as well.  Example:
> 
> (let ((str "THIS IS EITHER ARABIC OR HEBREW AND SHOULD ALL BE INVERTED.  
> CURRENTLY
> IT IS NOT REALLY AS JUSTIFIED AS IT COULD BE.  WE'LL LOOK AT THIS
> LATER.  cheers, alex."))
>   (bidi-reorder-string
>    str
>    (bidi-resolve-implicit-levels
>     (bidi-resolve-weak-types
>      (bidi-get-types str)))))
> 
> "RETAL
> SIHT TA KOOL LL'EW  .EB DLUOC TI SA DEIFITSUJ SA YLLAER TON SI TI
> YLTNERRUC  .DETREVNI EB LLA DLUOHS DNA WERBEH RO CIBARA REHTIE SI SIHT.  
> cheers, alex."

That's because you don't pay attention to newlines.

> Splitting on newlines, running the algorithm on single lines, and
> joining them again seems to work fine, however:

That's what you need to do: invert each line individually.



reply via email to

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