unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* BIDI question
@ 2013-10-07 17:25 Dmitry Antipov
  2013-10-07 17:54 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Antipov @ 2013-10-07 17:25 UTC (permalink / raw)
  To: Emacs development discussions; +Cc: Eli Zaretskii

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

There is a text with a mix of Arabic and ASCII characters (attached), and it is
displayed correctly (first screenshot a.k.a top.png). But, when I concatenate
this text with itself (cat /tmp/uthmani.txt /tmp/uthmani.txt > 1.txt) and view
the result, second Arabic fragment is rendered L2R (second screenshot a.k.a
next.png). Why it is different from the first Arabic fragment, and isn't it a bug?

Dmitry

[-- Attachment #2: uthmani.txt --]
[-- Type: text/plain, Size: 2594 bytes --]

بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ تَبَّتْ يَدَآ أَبِى لَهَبٍۢ وَتَبَّ
مَآ أَغْنَىٰ عَنْهُ مَالُهُۥ وَمَا كَسَبَ
سَيَصْلَىٰ نَارًۭا ذَاتَ لَهَبٍۢ
وَٱمْرَأَتُهُۥ حَمَّالَةَ ٱلْحَطَبِ
فِى جِيدِهَا حَبْلٌۭ مِّن مَّسَدٍۭ
بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ قُلْ هُوَ ٱللَّهُ أَحَدٌ
ٱللَّهُ ٱلصَّمَدُ
لَمْ يَلِدْ وَلَمْ يُولَدْ
وَلَمْ يَكُن لَّهُۥ كُفُوًا أَحَدٌۢ
بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ قُلْ أَعُوذُ بِرَبِّ ٱلْفَلَقِ
مِن شَرِّ مَا خَلَقَ
وَمِن شَرِّ غَاسِقٍ إِذَا وَقَبَ
وَمِن شَرِّ ٱلنَّفَّٰثَٰتِ فِى ٱلْعُقَدِ
وَمِن شَرِّ حَاسِدٍ إِذَا حَسَدَ
بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ قُلْ أَعُوذُ بِرَبِّ ٱلنَّاسِ
مَلِكِ ٱلنَّاسِ
إِلَٰهِ ٱلنَّاسِ
مِن شَرِّ ٱلْوَسْوَاسِ ٱلْخَنَّاسِ
ٱلَّذِى يُوَسْوِسُ فِى صُدُورِ ٱلنَّاسِ
مِنَ ٱلْجِنَّةِ وَٱلنَّاسِ


# PLEASE DO NOT REMOVE OR CHANGE THIS COPYRIGHT BLOCK
#====================================================================
#
#  Tanzil Quran Text (Uthmani, version 1.0.2)
#  Copyright (C) 2008-2010 Tanzil.net
#  License: Creative Commons Attribution 3.0
#
#  This copy of quran text is carefully produced, highly 
#  verified and continuously monitored by a group of specialists 
#  at Tanzil project.
#
#  TERMS OF USE:
#
#  - Permission is granted to copy and distribute verbatim copies 
#    of this text, but CHANGING IT IS NOT ALLOWED.
#
#  - This quran text can be used in any website or application, 
#    provided its source (Tanzil.net) is clearly indicated, and 
#    a link is made to http://tanzil.net to enable users to keep
#    track of changes.
#
#  - This copyright notice shall be included in all verbatim copies 
#    of the text, and shall be reproduced appropriately in all files 
#    derived from or containing substantial portion of this text.
#
#  Please check updates at: http://tanzil.net/updates/
# 
#====================================================================

[-- Attachment #3: top.png --]
[-- Type: image/png, Size: 48739 bytes --]

[-- Attachment #4: next.png --]
[-- Type: image/png, Size: 50762 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: BIDI question
  2013-10-07 17:25 BIDI question Dmitry Antipov
@ 2013-10-07 17:54 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2013-10-07 17:54 UTC (permalink / raw)
  To: Dmitry Antipov; +Cc: emacs-devel

> Date: Mon, 07 Oct 2013 21:25:54 +0400
> From: Dmitry Antipov <dmantipov@yandex.ru>
> CC: Eli Zaretskii <eliz@gnu.org>
> 
> There is a text with a mix of Arabic and ASCII characters (attached), and it is
> displayed correctly (first screenshot a.k.a top.png). But, when I concatenate
> this text with itself (cat /tmp/uthmani.txt /tmp/uthmani.txt > 1.txt) and view
> the result, second Arabic fragment is rendered L2R (second screenshot a.k.a
> next.png). Why it is different from the first Arabic fragment, and isn't it a bug?

It's a feature: a paragraph starts after at least one empty line (or
at point-min).  In this case, there's no empty line between the
English text (which is an L2R paragraph) and the second Arabic
fragment, so the second Arabic fragment is rendered as a continuation
of the L2R paragraph that starts with the English text.

IOW, Emacs does not recognize the second Arabic fragment as a new
paragraph, and does not recompute the base paragraph direction for it,
instead it continues using the base paragraph direction computed for
the English text.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-07 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-07 17:25 BIDI question Dmitry Antipov
2013-10-07 17:54 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).